Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit 7971c39c9a

@ -39,6 +39,23 @@ public class ReportDataController {
} }
} }
/**
*
*
* @param paramMap
* @return
*/
@GetMapping("/findInspectionTaskDetail")
public R findInspectionTaskDetail(@RequestParam(required = false) Map paramMap) {
try {
paramMap.put("site", CommonMethods.getSite());
List<Map<String, Object>> result = reportDataService.findInspectionTaskDetail(paramMap);
return R.ok(result);
} catch (Exception e) {
return R.failed(e.getMessage());
}
}
/** /**
* *
* *

@ -26,6 +26,6 @@ public interface PrintLogMapper extends BaseMapper<PrintLog> {
*/ */
List<PrintLog> getPrintLogListByCondition(PrintLog printLog); List<PrintLog> getPrintLogListByCondition(PrintLog printLog);
LabelPrintDto findSfcPrintInfoBySfc(@Param("sfc") String sfc, @Param("site") String site); List<LabelPrintDto> findSfcPrintInfoBySfc(@Param("sfc") String sfc, @Param("site") String site);
} }

@ -7,15 +7,14 @@ import java.util.Map;
@Repository @Repository
public interface ReportDataMapper { public interface ReportDataMapper {
List<Map<String, Object>> findInspectionTask(Map paramMap); List<Map<String, Object>> findInspectionTask(Map paramMap);
List<Map<String, Object>> findInspectionTaskDetail(Map paramMap);
List<Map<String, Object>> findResourceLoadRateInfo(Map paramMap); List<Map<String, Object>> findResourceLoadRateInfo(Map paramMap);
List<Map<String, Object>> findResourceRepairDataStatInfo(Map paramMap); List<Map<String, Object>> findResourceRepairDataStatInfo(Map paramMap);
List<Map<String, Object>> findProductStateInfo(Map paramMap); List<Map<String, Object>> findProductStateInfo(Map paramMap);
} }

@ -12,6 +12,14 @@ public interface ReportDataService {
*/ */
List<Map<String, Object>> findInspectionTask(Map paramMap); List<Map<String, Object>> findInspectionTask(Map paramMap);
/**
*
*
* @param paramMap
* @return
*/
List<Map<String, Object>> findInspectionTaskDetail(Map paramMap);
/** /**
* *
* *

@ -109,7 +109,12 @@ public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> i
@Override @Override
public LabelPrintDto findSfcPrintInfoBySfc(String sfc) { public LabelPrintDto findSfcPrintInfoBySfc(String sfc) {
return printLogMapper.findSfcPrintInfoBySfc(sfc,CommonMethods.getSite()); String site = CommonMethods.getSite();
List<LabelPrintDto> sfcPrintInfoBySfc = printLogMapper.findSfcPrintInfoBySfc(sfc, site);
if (sfcPrintInfoBySfc.size() < 1){
throw BusinessException.build("未找到生产的库存数据!");
}
return sfcPrintInfoBySfc.get(0);
} }
@Override @Override

@ -22,6 +22,11 @@ public class ReportDataServiceImpl implements ReportDataService{
return reportDataMapper.findInspectionTask(paramMap); return reportDataMapper.findInspectionTask(paramMap);
} }
@Override
public List<Map<String, Object>> findInspectionTaskDetail(Map paramMap) {
return reportDataMapper.findInspectionTaskDetail(paramMap);
}
@Override @Override
public List<Map<String, Object>> findResourceLoadRateInfo(Map paramMap) { public List<Map<String, Object>> findResourceLoadRateInfo(Map paramMap) {
return reportDataMapper.findResourceLoadRateInfo(paramMap); return reportDataMapper.findResourceLoadRateInfo(paramMap);

@ -584,6 +584,7 @@
LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = I.ITEM_BO AND CF."ATTRIBUTE" = 'DRAWING_REVISION' LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = I.ITEM_BO AND CF."ATTRIBUTE" = 'DRAWING_REVISION'
LEFT JOIN CUSTOM_FIELDS CFA ON CFA.HANDLE = I.ITEM_BO AND CFA."ATTRIBUTE" = 'ACCESSORY_TYPE' LEFT JOIN CUSTOM_FIELDS CFA ON CFA.HANDLE = I.ITEM_BO AND CFA."ATTRIBUTE" = 'ACCESSORY_TYPE'
WHERE S.SFC = #{sfc} AND I.SITE = #{site} WHERE S.SFC = #{sfc} AND I.SITE = #{site}
ORDER BY ZSD.BLANKING_SIZE
</select> </select>
<!--自定义sql--> <!--自定义sql-->

@ -128,4 +128,12 @@
</select> </select>
<select id="findInspectionTaskDetail" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT ROWNUM SEQ, A.SITE, A.TASK_NO, A.DESCRIPTION, A.RESULT CHECK_RESULT, A.CREATE_USER CHECK_USER, A.CREATED_DATE_TIME CHECK_DATE, C.INSPECTION_ITEM_NO, C.DESCRIPTION, D.PARAM_NO, D.DESCRIPTION PARAM_DESC, D.INSPECTION_METHOD, D.MIN_VALUE, D.STANDARD_VALUE, D.MAX_VALUE, B.CHECK_VALUES, B."RESULT"
FROM Z_INSPECTION_TASK A
LEFT JOIN Z_INSPECTION_ITEM C ON A.INSPECTION_ITEM_BO = C.HANDLE
INNER JOIN Z_INSPECTION_TASK_DETAIL B ON A.HANDLE = B.TASK_BO
LEFT JOIN Z_INSPECTION_ITEM_DETAIL D ON B.INSPECTION_ITEM_DETAIL_BO = D.HANDLE AND C.HANDLE = D.INSPECTION_ITEM_BO
WHERE A.SITE = #{site} AND A.TASK_NO = #{taskNo}
</select>
</mapper> </mapper>

@ -0,0 +1,34 @@
package com.foreverwin.mesnac.dispatch.dto;
import java.io.Serializable;
public class SfcDispatchEmployeeDto implements Serializable {
private String site;
private String sfcDispatchBo;
private String [] dispatchEmployee;
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getSfcDispatchBo() {
return sfcDispatchBo;
}
public void setSfcDispatchBo(String sfcDispatchBo) {
this.sfcDispatchBo = sfcDispatchBo;
}
public String[] getDispatchEmployee() {
return dispatchEmployee;
}
public void setDispatchEmployee(String[] dispatchEmployee) {
this.dispatchEmployee = dispatchEmployee;
}
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.dto.SfcDispatchEmployeeDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author Leon.L
* @since 2021-09-02
*/
@Repository
public interface SfcDispatchEmployeeMapper extends BaseMapper<SfcDispatchEmployee> {
void deleteSfcDispatchEmployee(List<SfcDispatchEmployeeDto> list);
}

@ -0,0 +1,119 @@
package com.foreverwin.mesnac.dispatch.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-09-02
*/
@TableName("Z_SFC_DISPATCH_EMPLOYEE")
public class SfcDispatchEmployee extends Model<SfcDispatchEmployee> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("SITE")
private String site;
@TableField("SFC_DISPATCH_BO")
private String sfcDispatchBo;
@TableField("EMPLOYEE")
private String employee;
@TableField("CREATE_USER")
private String createUser;
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getSfcDispatchBo() {
return sfcDispatchBo;
}
public void setSfcDispatchBo(String sfcDispatchBo) {
this.sfcDispatchBo = sfcDispatchBo;
}
public String getEmployee() {
return employee;
}
public void setEmployee(String employee) {
this.employee = employee;
}
public String getCreateUser() {
return createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
public static final String EMPLOYEE = "EMPLOYEE";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "SfcDispatchEmployee{" +
"handle = " + handle +
", site = " + site +
", sfcDispatchBo = " + sfcDispatchBo +
", employee = " + employee +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
"}";
}
}

@ -0,0 +1,20 @@
package com.foreverwin.mesnac.dispatch.service;
import com.foreverwin.mesnac.dispatch.dto.SfcDispatchEmployeeDto;
import com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-09-02
*/
public interface SfcDispatchEmployeeService extends IService<SfcDispatchEmployee> {
void saveSfcDispatchEmployee(List<SfcDispatchEmployeeDto> sfcDispatchEmployeeList);
}

@ -0,0 +1,70 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.foreverwin.mesnac.dispatch.dto.SfcDispatchEmployeeDto;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchEmployeeMapper;
import com.foreverwin.mesnac.dispatch.service.SfcDispatchEmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-09-02
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcDispatchEmployeeServiceImpl extends ServiceImpl<SfcDispatchEmployeeMapper, SfcDispatchEmployee> implements SfcDispatchEmployeeService {
@Autowired
private SfcDispatchEmployeeMapper sfcDispatchEmployeeMapper;
@Override
public void saveSfcDispatchEmployee(List<SfcDispatchEmployeeDto> sfcDispatchEmployeeList) {
if (sfcDispatchEmployeeList == null || sfcDispatchEmployeeList.size() <= 0) {
return;
}
String user = CommonMethods.getUser();
LocalDateTime nowDate = LocalDateTime.now();
List<SfcDispatchEmployee> list = new ArrayList<>();
for (int i = 0; i < sfcDispatchEmployeeList.size(); i++) {
SfcDispatchEmployeeDto disDto = sfcDispatchEmployeeList.get(i);
String [] array = disDto.getDispatchEmployee();
if (array == null || array.length <= 0) {
continue;
}
for (int j = 0; j < array.length; j++) {
SfcDispatchEmployee sfcDispatchEmployee = new SfcDispatchEmployee();
sfcDispatchEmployee.setHandle(UUID.randomUUID().toString());
sfcDispatchEmployee.setSite(disDto.getSite());
sfcDispatchEmployee.setSfcDispatchBo(disDto.getSfcDispatchBo());
sfcDispatchEmployee.setEmployee(array[j]);
sfcDispatchEmployee.setCreateUser(user);
sfcDispatchEmployee.setCreatedDateTime(nowDate);
list.add(sfcDispatchEmployee);
}
}
//删除派工人员
sfcDispatchEmployeeMapper.deleteSfcDispatchEmployee(sfcDispatchEmployeeList);
//保存派工人员
if (list != null && list.size() > 0) {
this.saveBatch(list);
}
}
}

@ -14,10 +14,12 @@ import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.ExcelUtils; import com.foreverwin.mesnac.common.util.ExcelUtils;
import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.dispatch.dto.RouterDTO; import com.foreverwin.mesnac.dispatch.dto.RouterDTO;
import com.foreverwin.mesnac.dispatch.dto.SfcDispatchEmployeeDto;
import com.foreverwin.mesnac.dispatch.dto.WorkCenterWorkTimeDTO; import com.foreverwin.mesnac.dispatch.dto.WorkCenterWorkTimeDTO;
import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper; import com.foreverwin.mesnac.dispatch.mapper.SfcDispatchMapper;
import com.foreverwin.mesnac.dispatch.model.CallItem; import com.foreverwin.mesnac.dispatch.model.CallItem;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch; import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee;
import com.foreverwin.mesnac.dispatch.model.UserResource; import com.foreverwin.mesnac.dispatch.model.UserResource;
import com.foreverwin.mesnac.dispatch.service.*; import com.foreverwin.mesnac.dispatch.service.*;
import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO; import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO;
@ -83,6 +85,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
private WorkCenterMemberService workCenterMemberService; private WorkCenterMemberService workCenterMemberService;
@Autowired @Autowired
private ProductionCalendarService productionCalendarService; private ProductionCalendarService productionCalendarService;
@Autowired
private SfcDispatchEmployeeService sfcDispatchEmployeeService;
@Override @Override
public List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId) { public List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId) {
@ -387,6 +391,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
} }
int seq = 0; int seq = 0;
List<SfcDispatchEmployeeDto> sfcDispatchEmployeeList = new ArrayList<>();
//状态标识,表示本次派工成功或是失败 //状态标识,表示本次派工成功或是失败
Boolean flag = true; Boolean flag = true;
LocalDateTime nowDate = LocalDateTime.now(); LocalDateTime nowDate = LocalDateTime.now();
@ -400,6 +405,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
String dispatchNo = sfcDispatchDto.getDispatchNo(); String dispatchNo = sfcDispatchDto.getDispatchNo();
String resourceType = sfcDispatchDto.getResourceType(); String resourceType = sfcDispatchDto.getResourceType();
String [] employeeArray = null;
Map<String, Object> disMap = new HashMap<>();
//派工导入 //派工导入
if (DispatchStatusEnum.IMPORT.getCode().equals(type)) { if (DispatchStatusEnum.IMPORT.getCode().equals(type)) {
String handle = HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo); String handle = HandleEnum.SFC_DISPATCH.getHandle(site, dispatchNo);
@ -432,7 +439,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
String _employeeDescription; String _employeeDescription;
String []employeeDescriptionArray = employeeDescription.split(","); String []employeeDescriptionArray = employeeDescription.split(",");
String []employeeArray = new String[employeeDescriptionArray.length]; employeeArray = new String[employeeDescriptionArray.length];
for (int i = 0; i < employeeDescriptionArray.length; i++) { for (int i = 0; i < employeeDescriptionArray.length; i++) {
_employeeDescription = employeeDescriptionArray[i]; _employeeDescription = employeeDescriptionArray[i];
List<NwaUser> _list = userMap.get(_employeeDescription); List<NwaUser> _list = userMap.get(_employeeDescription);
@ -546,7 +553,7 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
} }
//派工人员为多个(只要一个匹配) //派工人员为多个(只要一个匹配)
String []employeeArray = employees.split(","); employeeArray = employees.split(",");
Boolean isMatch = false; Boolean isMatch = false;
for (int m = 0; m < employeeArray.length; m++) { for (int m = 0; m < employeeArray.length; m++) {
String employee = employeeArray[m]; String employee = employeeArray[m];
@ -594,6 +601,15 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
sfcDispatch.setIsDispatch("true"); sfcDispatch.setIsDispatch("true");
} }
list.add(sfcDispatch); list.add(sfcDispatch);
//记录派工人员
if (employeeArray != null && employeeArray.length > 0) {
SfcDispatchEmployeeDto sfcDispatchEmployee = new SfcDispatchEmployeeDto();
sfcDispatchEmployee.setSite(site);
sfcDispatchEmployee.setSfcDispatchBo(sfcDispatchDto.getHandle());
sfcDispatchEmployee.setDispatchEmployee(employeeArray);
sfcDispatchEmployeeList.add(sfcDispatchEmployee);
}
} }
//执行更新 //执行更新
@ -601,6 +617,9 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
this.updateBatchById(list); this.updateBatchById(list);
} }
//记录派工人员明细
sfcDispatchEmployeeService.saveSfcDispatchEmployee(sfcDispatchEmployeeList);
return flag; return flag;
} }

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.foreverwin.mesnac.dispatch.mapper.SfcDispatchEmployeeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="EMPLOYEE" property="employee" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, SFC_DISPATCH_BO, EMPLOYEE, CREATE_USER, CREATED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DISPATCH_EMPLOYEE WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH_EMPLOYEE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SFC_DISPATCH_EMPLOYEE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee">
INSERT INTO Z_SFC_DISPATCH_EMPLOYEE
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="sfcDispatchBo!=null">SFC_DISPATCH_BO,</if>
<if test="employee!=null">EMPLOYEE,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="sfcDispatchBo!=null">#{sfcDispatchBo},</if>
<if test="employee!=null">#{employee},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.SfcDispatchEmployee">
INSERT INTO Z_SFC_DISPATCH_EMPLOYEE
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{sfcDispatchBo},
#{employee},
#{createUser},
#{createdDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_SFC_DISPATCH_EMPLOYEE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_SFC_DISPATCH_EMPLOYEE <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
EMPLOYEE=#{et.employee},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_SFC_DISPATCH_EMPLOYEE <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_SFC_DISPATCH_EMPLOYEE WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_SFC_DISPATCH_EMPLOYEE
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_SFC_DISPATCH_EMPLOYEE
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_SFC_DISPATCH_EMPLOYEE WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<delete id="deleteSfcDispatchEmployee">
DELETE FROM Z_SFC_DISPATCH_EMPLOYEE
WHERE SFC_DISPATCH_BO IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.sfcDispatchBo}
</foreach>
</delete>
</mapper>

@ -31,9 +31,9 @@ public class GeneratorApplication {
dataSourceConfig.setTypeConvert( new OracleTypeConvert() ); dataSourceConfig.setTypeConvert( new OracleTypeConvert() );
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig) MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" ) .tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.production" ) .packageName( "com.foreverwin.mesnac.dispatch" )
.tables("Z_CUTTER_LOG") .tables("Z_SFC_DISPATCH_EMPLOYEE")
.author("Philip") .author("Leon.L")
.uiAppId("com.foreverwin.me") .uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.production") .uiPackage("com.foreverwin.me.production")
.build(); .build();

Loading…
Cancel
Save