自报待办

philip 4 years ago
parent 6112e89710
commit 220f1c026f

@ -0,0 +1,137 @@
package com.foreverwin.mesnac.quality.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author Philip
* @since 2021-06-17
*/
@RestController
@RequestMapping("/Z-SELF-REPORT")
public class SelfReportController {
@Autowired
public SelfReportService selfReportService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getSelfReportById(@PathVariable String id) {
return R.ok( selfReportService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/selectList")
public R getSelfReportList(SelfReport selfReport){
List<SelfReport> result;
QueryWrapper<SelfReport> queryWrapper = new QueryWrapper<>();
selfReport.setSite(CommonMethods.getSite());
queryWrapper.setEntity(selfReport);
result = selfReportService.selectList(queryWrapper, LocaleContextHolder.getLocale().getLanguage(),selfReport.getStartTime(),selfReport.getEndTime());
return R.ok(result);
}
@ResponseBody
@RequestMapping("/reject")
public R updateById(String handle){
return R.ok(selfReportService.reject(handle));
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<SelfReport> frontPage, SelfReport selfReport){
IPage result;
QueryWrapper<SelfReport> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(selfReport);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(SelfReport::getHandle, frontPage.getGlobalQuery())
.or().like(SelfReport::getSite, frontPage.getGlobalQuery())
.or().like(SelfReport::getTaskNo, frontPage.getGlobalQuery())
.or().like(SelfReport::getWorkCenter, frontPage.getGlobalQuery())
.or().like(SelfReport::getShopOrder, frontPage.getGlobalQuery())
.or().like(SelfReport::getItem, frontPage.getGlobalQuery())
.or().like(SelfReport::getOpStep, frontPage.getGlobalQuery())
.or().like(SelfReport::getResrce, frontPage.getGlobalQuery())
.or().like(SelfReport::getSfc, frontPage.getGlobalQuery())
.or().like(SelfReport::getNcCode, frontPage.getGlobalQuery())
.or().like(SelfReport::getLocation, frontPage.getGlobalQuery())
.or().like(SelfReport::getState, frontPage.getGlobalQuery())
.or().like(SelfReport::getRemark, frontPage.getGlobalQuery())
.or().like(SelfReport::getCreateUser, frontPage.getGlobalQuery())
.or().like(SelfReport::getModifyUser, frontPage.getGlobalQuery())
);
}
result = selfReportService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param selfReport
* @return null
*/
@PostMapping
public R save(@RequestBody SelfReport selfReport) {
return R.ok(selfReportService.save(selfReport));
}
/**
*
* @param selfReport
* @return null
*/
@PutMapping
public R updateById(@RequestBody SelfReport selfReport) {
return R.ok(selfReportService.updateById(selfReport));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(selfReportService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(selfReportService.removeByIds(ids));
}
}

@ -0,0 +1,24 @@
package com.foreverwin.mesnac.quality.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDate;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-06-17
*/
@Repository
public interface SelfReportMapper extends BaseMapper<SelfReport> {
List<SelfReport> selectList(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime);
}

@ -0,0 +1,369 @@
package com.foreverwin.mesnac.quality.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-06-21
*/
@TableName("Z_SELF_REPORT")
public class SelfReport extends Model<SelfReport> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("TASK_NO")
private String taskNo;
/**
*
*/
@TableField("WORK_CENTER")
private String workCenter;
/**
*
*/
@TableField("SHOP_ORDER")
private String shopOrder;
/**
*
*/
@TableField("ITEM")
private String item;
/**
* /
*/
@TableField("OP_STEP")
private String opStep;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("SFC")
private String sfc;
/**
*
*/
@TableField("NC_CODE")
private String ncCode;
/**
*
*/
@TableField("NC_QTY")
private Double ncQty;
/**
*
*/
@TableField("LOCATION")
private String location;
/**
* |NEW|CONF|REJ
*/
@TableField("STATE")
private String state;
/**
*
*/
@TableField("REMARK")
private String remark;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
/**
*
*/
@TableField(exist = false)
private LocalDate startTime;
/**
*
*/
@TableField(exist = false)
private LocalDate endTime;
/**
*
*/
@TableField(exist = false)
private String description;
public LocalDate getStartTime() {
return startTime;
}
public void setStartTime(LocalDate startTime) {
this.startTime = startTime;
}
public LocalDate getEndTime() {
return endTime;
}
public void setEndTime(LocalDate endTime) {
this.endTime = endTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
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 getTaskNo() {
return taskNo;
}
public void setTaskNo(String taskNo) {
this.taskNo = taskNo;
}
public String getWorkCenter() {
return workCenter;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getOpStep() {
return opStep;
}
public void setOpStep(String opStep) {
this.opStep = opStep;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getSfc() {
return sfc;
}
public void setSfc(String sfc) {
this.sfc = sfc;
}
public String getNcCode() {
return ncCode;
}
public void setNcCode(String ncCode) {
this.ncCode = ncCode;
}
public Double getNcQty() {
return ncQty;
}
public void setNcQty(Double ncQty) {
this.ncQty = ncQty;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
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 String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String TASK_NO = "TASK_NO";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String ITEM = "ITEM";
public static final String OP_STEP = "OP_STEP";
public static final String RESRCE = "RESRCE";
public static final String SFC = "SFC";
public static final String NC_CODE = "NC_CODE";
public static final String NC_QTY = "NC_QTY";
public static final String LOCATION = "LOCATION";
public static final String STATE = "STATE";
public static final String REMARK = "REMARK";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "SelfReport{" +
"handle = " + handle +
", site = " + site +
", taskNo = " + taskNo +
", workCenter = " + workCenter +
", shopOrder = " + shopOrder +
", item = " + item +
", opStep = " + opStep +
", resrce = " + resrce +
", sfc = " + sfc +
", ncCode = " + ncCode +
", ncQty = " + ncQty +
", location = " + location +
", state = " + state +
", remark = " + remark +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,34 @@
package com.foreverwin.mesnac.quality.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.time.LocalDate;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-06-17
*/
public interface SelfReportService extends IService<SelfReport> {
/**
*
* @param frontPage
* @return
*/
IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport);
List<SelfReport> selectList(SelfReport selfReport);
Object reject(String handle);
List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime);
}

@ -0,0 +1,72 @@
package com.foreverwin.mesnac.quality.service.impl;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.quality.model.SelfReport;
import com.foreverwin.mesnac.quality.mapper.SelfReportMapper;
import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.visiprise.common.exception.BaseException;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-06-17
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfReport> implements SelfReportService {
@Autowired
private SelfReportMapper selfReportMapper;
static final String STATE_NEW="NEW";
static final String STATE_CONFIRM="CONF";
static final String STATE_REJECT="REJ";
@Override
public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) {
QueryWrapper<SelfReport> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(selfReport);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<SelfReport> selectList(SelfReport selfReport) {
QueryWrapper<SelfReport> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(selfReport);
return super.list(queryWrapper);
}
@Override
public List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime) {
return selfReportMapper.selectList(queryWrapper,locale,startTime,endTime);
}
@Override
public Object reject(String handle) {
SelfReport selfReport = getById(handle);
if (!selfReport.getState().equals(STATE_NEW)){
throw new BaseException("状态不为新建,请重新检索");
}
selfReport.setState(STATE_REJECT);
selfReport.setModifiedDateTime(LocalDateTime.now());
selfReport.setModifyUser(CommonMethods.getUser());
return updateById(selfReport);
}
}

@ -0,0 +1,534 @@
<?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.quality.mapper.SelfReportMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.quality.model.SelfReport">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="TASK_NO" property="taskNo" />
<result column="WORK_CENTER" property="workCenter" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="ITEM" property="item" />
<result column="OP_STEP" property="opStep" />
<result column="RESRCE" property="resrce" />
<result column="SFC" property="sfc" />
<result column="NC_CODE" property="ncCode" />
<result column="NC_QTY" property="ncQty" />
<result column="LOCATION" property="location" />
<result column="STATE" property="state" />
<result column="REMARK" property="remark" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TASK_NO, WORK_CENTER, SHOP_ORDER, ITEM, OP_STEP, RESRCE, SFC, NC_CODE, NC_QTY, LOCATION, STATE, REMARK, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_SELF_REPORT WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_SELF_REPORT
<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_SELF_REPORT 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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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 ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, ZSR.CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true'
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}
<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 ZSR.SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskNo!=null"> AND ZSR.TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null and ew.entity.workCenter!='' "> AND ZSR.WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null and ew.entity.shopOrder!=''"> AND ZSR.SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null and ew.entity.item!=''"> AND ZSR.ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null and ew.entity.opStep!=''"> AND ZSR.OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND ZSR.RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null and ew.entity.sfc!='' "> AND ZSR.SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND ZSR.NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND ZSR.NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND ZSR.LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null and ew.entity.state!=''"> AND ZSR.STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND ZSR.REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND ZSR.CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND ZSR.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND ZSR.MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND ZSR.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="startTime!=null"> AND ZSR.CREATED_DATE_TIME >=#{startTime}</if>
<if test="endTime!=null"> AND ZSR.CREATED_DATE_TIME &lt;=#{endTime}</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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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.quality.model.SelfReport">
INSERT INTO Z_SELF_REPORT
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="taskNo!=null">TASK_NO,</if>
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="shopOrder!=null">SHOP_ORDER,</if>
<if test="item!=null">ITEM,</if>
<if test="opStep!=null">OP_STEP,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="sfc!=null">SFC,</if>
<if test="ncCode!=null">NC_CODE,</if>
<if test="ncQty!=null">NC_QTY,</if>
<if test="location!=null">LOCATION,</if>
<if test="state!=null">STATE,</if>
<if test="remark!=null">REMARK,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="taskNo!=null">#{taskNo},</if>
<if test="workCenter!=null">#{workCenter},</if>
<if test="shopOrder!=null">#{shopOrder},</if>
<if test="item!=null">#{item},</if>
<if test="opStep!=null">#{opStep},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="sfc!=null">#{sfc},</if>
<if test="ncCode!=null">#{ncCode},</if>
<if test="ncQty!=null">#{ncQty},</if>
<if test="location!=null">#{location},</if>
<if test="state!=null">#{state},</if>
<if test="remark!=null">#{remark},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.quality.model.SelfReport">
INSERT INTO Z_SELF_REPORT
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{taskNo},
#{workCenter},
#{shopOrder},
#{item},
#{opStep},
#{resrce},
#{sfc},
#{ncCode},
#{ncQty},
#{location},
#{state},
#{remark},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_SELF_REPORT <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.taskNo!=null">TASK_NO=#{et.taskNo},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.opStep!=null">OP_STEP=#{et.opStep},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.ncCode!=null">NC_CODE=#{et.ncCode},</if>
<if test="et.ncQty!=null">NC_QTY=#{et.ncQty},</if>
<if test="et.location!=null">LOCATION=#{et.location},</if>
<if test="et.state!=null">STATE=#{et.state},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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_SELF_REPORT <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
TASK_NO=#{et.taskNo},
WORK_CENTER=#{et.workCenter},
SHOP_ORDER=#{et.shopOrder},
ITEM=#{et.item},
OP_STEP=#{et.opStep},
RESRCE=#{et.resrce},
SFC=#{et.sfc},
NC_CODE=#{et.ncCode},
NC_QTY=#{et.ncQty},
LOCATION=#{et.location},
STATE=#{et.state},
REMARK=#{et.remark},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</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_SELF_REPORT <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.taskNo!=null">TASK_NO=#{et.taskNo},</if>
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.opStep!=null">OP_STEP=#{et.opStep},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
<if test="et.ncCode!=null">NC_CODE=#{et.ncCode},</if>
<if test="et.ncQty!=null">NC_QTY=#{et.ncQty},</if>
<if test="et.location!=null">LOCATION=#{et.location},</if>
<if test="et.state!=null">STATE=#{et.state},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_SELF_REPORT WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_SELF_REPORT
<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_SELF_REPORT
<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.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_SELF_REPORT WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>
Loading…
Cancel
Save