检验人员多选
parent
63cc8e2053
commit
4e65a7d092
@ -0,0 +1,212 @@
|
||||
package com.op.quality.domain;
|
||||
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
||||
public class QcCheckTaskUser extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 生产过程检验任务--检验人 qc_check_task_user
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String recordId;
|
||||
|
||||
/**
|
||||
* 检验任务编号
|
||||
*/
|
||||
@Excel(name = "检验任务编号")
|
||||
private String checkNo;
|
||||
|
||||
/**
|
||||
* 检测人工号
|
||||
*/
|
||||
@Excel(name = "检测人工号")
|
||||
private String checkManCode;
|
||||
|
||||
/**
|
||||
* 检测人姓名
|
||||
*/
|
||||
@Excel(name = "检测人姓名")
|
||||
private String checkManName;
|
||||
|
||||
/**
|
||||
* 预留字段1
|
||||
*/
|
||||
@Excel(name = "预留字段1")
|
||||
private String attr1;
|
||||
|
||||
/**
|
||||
* 预留字段2
|
||||
*/
|
||||
@Excel(name = "预留字段2")
|
||||
private String attr2;
|
||||
|
||||
/**
|
||||
* 预留字段3
|
||||
*/
|
||||
@Excel(name = "预留字段3")
|
||||
private String attr3;
|
||||
|
||||
/**
|
||||
* 预留字段4
|
||||
*/
|
||||
@Excel(name = "预留字段4")
|
||||
private String attr4;
|
||||
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@Excel(name = "工厂编码")
|
||||
private String factoryCode;
|
||||
|
||||
/**
|
||||
* 删除标识1删除0正常
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 属于
|
||||
*/
|
||||
private String belongTo;
|
||||
|
||||
private String manNames;
|
||||
private String manCodes;
|
||||
|
||||
public String getManNames() {
|
||||
return manNames;
|
||||
}
|
||||
|
||||
public void setManNames(String manNames) {
|
||||
this.manNames = manNames;
|
||||
}
|
||||
|
||||
public String getManCodes() {
|
||||
return manCodes;
|
||||
}
|
||||
|
||||
public void setManCodes(String manCodes) {
|
||||
this.manCodes = manCodes;
|
||||
}
|
||||
|
||||
public String getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(String recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getCheckNo() {
|
||||
return checkNo;
|
||||
}
|
||||
|
||||
public void setCheckNo(String checkNo) {
|
||||
this.checkNo = checkNo;
|
||||
}
|
||||
|
||||
public String getCheckManCode() {
|
||||
return checkManCode;
|
||||
}
|
||||
|
||||
public void setCheckManCode(String checkManCode) {
|
||||
this.checkManCode = checkManCode;
|
||||
}
|
||||
|
||||
public String getCheckManName() {
|
||||
return checkManName;
|
||||
}
|
||||
|
||||
public void setCheckManName(String checkManName) {
|
||||
this.checkManName = checkManName;
|
||||
}
|
||||
|
||||
public String getAttr1() {
|
||||
return attr1;
|
||||
}
|
||||
|
||||
public void setAttr1(String attr1) {
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr2() {
|
||||
return attr2;
|
||||
}
|
||||
|
||||
public void setAttr2(String attr2) {
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr3() {
|
||||
return attr3;
|
||||
}
|
||||
|
||||
public void setAttr3(String attr3) {
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public String getAttr4() {
|
||||
return attr4;
|
||||
}
|
||||
|
||||
public void setAttr4(String attr4) {
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getBelongTo() {
|
||||
return belongTo;
|
||||
}
|
||||
|
||||
public void setBelongTo(String belongTo) {
|
||||
this.belongTo = belongTo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("recordId", getRecordId())
|
||||
.append("checkNo", getCheckNo())
|
||||
.append("checkManCode", getCheckManCode())
|
||||
.append("checkManName", getCheckManName())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("factoryCode", getFactoryCode())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.op.quality.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.quality.domain.QcCheckTaskUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 来料检验任务--检查人Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
@Mapper
|
||||
public interface QcCheckTaskUserMapper {
|
||||
/**
|
||||
* 查询来料检验任务--检查人
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 来料检验任务--检查人
|
||||
*/
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--检查人列表
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 来料检验任务--检查人集合
|
||||
*/
|
||||
public List<QcCheckTaskUser> selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--检查人
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskUserByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--检查人
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskUserByRecordIds(String[] recordIds);
|
||||
|
||||
/**
|
||||
* 批量插入检验人数据
|
||||
*/
|
||||
public int insertQcCheckTaskUserList(List<QcCheckTaskUser> qcCheckTaskUserList);
|
||||
|
||||
public int deleteQcCheckTaskUserByBelongTo(String belongTo);
|
||||
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo);
|
||||
|
||||
public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.quality.domain.QcCheckTaskUser;
|
||||
|
||||
/**
|
||||
* 来料检验任务--检查人Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
public interface IQcCheckTaskUserService {
|
||||
/**
|
||||
* 查询来料检验任务--检查人
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 来料检验任务--检查人
|
||||
*/
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--检查人列表
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 来料检验任务--检查人集合
|
||||
*/
|
||||
public List<QcCheckTaskUser> selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckTaskUser(List<QcCheckTaskUser> qcCheckTaskUser);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--检查人
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验任务--检查人主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskUserByRecordIds(String[] recordIds);
|
||||
|
||||
public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray);
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--检查人信息
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskUserByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 用户数据批量插入
|
||||
*/
|
||||
public int insertQcCheckTaskUserList(List<QcCheckTaskUser> qcCheckTaskUserList);
|
||||
/**
|
||||
* 根据任务编号查询检验人
|
||||
*/
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo);
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package com.op.quality.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.StringUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.quality.mapper.QcCheckTaskUserMapper;
|
||||
import com.op.quality.domain.QcCheckTaskUser;
|
||||
import com.op.quality.service.IQcCheckTaskUserService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 来料检验任务--检查人Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
@Service
|
||||
public class QcCheckTaskUserServiceImpl implements IQcCheckTaskUserService {
|
||||
@Autowired
|
||||
private QcCheckTaskUserMapper qcCheckTaskUserMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--检查人
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 来料检验任务--检查人
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByRecordId(String recordId) {
|
||||
return qcCheckTaskUserMapper.selectQcCheckTaskUserByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--检查人列表
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 来料检验任务--检查人
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckTaskUser> selectQcCheckTaskUserList(QcCheckTaskUser qcCheckTaskUser) {
|
||||
return qcCheckTaskUserMapper.selectQcCheckTaskUserList(qcCheckTaskUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcCheckTaskUser(QcCheckTaskUser qcCheckTaskUser) {
|
||||
qcCheckTaskUser.setCreateTime(DateUtils.getNowDate());
|
||||
return qcCheckTaskUserMapper.insertQcCheckTaskUser(qcCheckTaskUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--检查人
|
||||
*
|
||||
* @param qcCheckTaskUser 来料检验任务--检查人
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateQcCheckTaskUser(List<QcCheckTaskUser> qcCheckTaskUserList) {
|
||||
if (CollectionUtils.isEmpty(qcCheckTaskUserList)){
|
||||
return 0;
|
||||
}
|
||||
String belongTo = qcCheckTaskUserList.get(0).getBelongTo();
|
||||
//根据belongTo删除
|
||||
qcCheckTaskUserMapper.deleteQcCheckTaskUserByBelongTo(belongTo);
|
||||
|
||||
//获取当前所选工厂
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String key = "#header.poolName";
|
||||
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
|
||||
//遍历赋值
|
||||
for (QcCheckTaskUser qcCheckTaskUser : qcCheckTaskUserList){
|
||||
qcCheckTaskUser.setRecordId(IdUtils.fastSimpleUUID());
|
||||
qcCheckTaskUser.setCreateTime(DateUtils.getNowDate());
|
||||
qcCheckTaskUser.setCreateBy(SecurityUtils.getUsername());
|
||||
qcCheckTaskUser.setFactoryCode(factoryCode);
|
||||
}
|
||||
//重新插入数据
|
||||
return qcCheckTaskUserMapper.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--检查人
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验任务--检查人主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckTaskUserByRecordIds(String[] recordIds) {
|
||||
return qcCheckTaskUserMapper.deleteQcCheckTaskUserByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckTaskUserByBelongTos(String[] belongToArray) {
|
||||
return qcCheckTaskUserMapper.deleteQcCheckTaskUserByBelongTos(belongToArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--检查人信息
|
||||
*
|
||||
* @param recordId 来料检验任务--检查人主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteQcCheckTaskUserByRecordId(String recordId) {
|
||||
return qcCheckTaskUserMapper.deleteQcCheckTaskUserByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcCheckTaskUserList(List<QcCheckTaskUser> qcCheckTaskUserList) {
|
||||
if (CollectionUtils.isEmpty(qcCheckTaskUserList)){
|
||||
return 0;
|
||||
}
|
||||
//获取当前所选工厂
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String key = "#header.poolName";
|
||||
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
|
||||
//遍历赋值
|
||||
for (QcCheckTaskUser qcCheckTaskUser : qcCheckTaskUserList){
|
||||
qcCheckTaskUser.setRecordId(IdUtils.fastSimpleUUID());
|
||||
qcCheckTaskUser.setCreateTime(DateUtils.getNowDate());
|
||||
qcCheckTaskUser.setCreateBy(SecurityUtils.getUsername());
|
||||
qcCheckTaskUser.setFactoryCode(factoryCode);
|
||||
}
|
||||
return qcCheckTaskUserMapper.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcCheckTaskUser selectQcCheckTaskUserByBelongTo(String belongTo) {
|
||||
return qcCheckTaskUserMapper.selectQcCheckTaskUserByBelongTo(belongTo);
|
||||
}
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
<?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.op.quality.mapper.QcCheckTaskUserMapper">
|
||||
|
||||
<resultMap type="QcCheckTaskUser" id="QcCheckTaskUserResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="checkNo" column="check_no" />
|
||||
<result property="checkManCode" column="check_man_code" />
|
||||
<result property="checkManName" column="check_man_name" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQcCheckTaskUserVo">
|
||||
select record_id, check_no, check_man_code, check_man_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task_user
|
||||
</sql>
|
||||
|
||||
<select id="selectQcCheckTaskUserList" parameterType="QcCheckTaskUser" resultMap="QcCheckTaskUserResult">
|
||||
<include refid="selectQcCheckTaskUserVo"/>
|
||||
<where>
|
||||
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
|
||||
<if test="checkManCode != null and checkManCode != ''"> and check_man_code = #{checkManCode}</if>
|
||||
<if test="checkManName != null and checkManName != ''"> and check_man_name like concat('%', #{checkManName}, '%')</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQcCheckTaskUserByRecordId" parameterType="String" resultMap="QcCheckTaskUserResult">
|
||||
<include refid="selectQcCheckTaskUserVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQcCheckTaskUser" parameterType="QcCheckTaskUser">
|
||||
insert into qc_check_task_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="checkNo != null">check_no,</if>
|
||||
<if test="checkManCode != null">check_man_code,</if>
|
||||
<if test="checkManName != null">check_man_name,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="belongTo != null">belong_to,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="checkNo != null">#{checkNo},</if>
|
||||
<if test="checkManCode != null">#{checkManCode},</if>
|
||||
<if test="checkManName != null">#{checkManName},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="belongTo != null">#{belongTo},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQcCheckTaskUser" parameterType="QcCheckTaskUser">
|
||||
update qc_check_task_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="checkNo != null">check_no = #{checkNo},</if>
|
||||
<if test="checkManCode != null">check_man_code = #{checkManCode},</if>
|
||||
<if test="checkManName != null">check_man_name = #{checkManName},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="belongTo != null">belong_to = #{belongTo},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcCheckTaskUserByRecordId" parameterType="String">
|
||||
delete from qc_check_task_user where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcCheckTaskUserByRecordIds" parameterType="String">
|
||||
delete from qc_check_task_user where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcCheckTaskUserByBelongTo" parameterType="String">
|
||||
delete from qc_check_task_user where belong_to = #{belongTo}
|
||||
</delete>
|
||||
|
||||
<insert id="insertQcCheckTaskUserList" parameterType="List">
|
||||
insert into qc_check_task_user(
|
||||
record_id,
|
||||
check_no,
|
||||
check_man_code,
|
||||
check_man_name,
|
||||
attr1,
|
||||
attr2,
|
||||
attr3,
|
||||
attr4,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
factory_code,
|
||||
del_flag,
|
||||
belong_to
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{item.recordId},
|
||||
#{item.checkNo},
|
||||
#{item.checkManCode},
|
||||
#{item.checkManName},
|
||||
#{item.attr1},
|
||||
#{item.attr2},
|
||||
#{item.attr3},
|
||||
#{item.attr4},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime},
|
||||
#{item.factoryCode},
|
||||
#{item.delFlag},
|
||||
#{item.belongTo}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectQcCheckTaskUserByBelongTo" parameterType="String" resultMap="QcCheckTaskUserResult">
|
||||
select
|
||||
STRING_AGG(check_man_code,',') AS 'manCodes',
|
||||
STRING_AGG(check_man_name,',') AS 'manNames',
|
||||
belong_to
|
||||
from qc_check_task_user
|
||||
where belong_to = #{belongTo}
|
||||
group by belong_to
|
||||
</select>
|
||||
|
||||
<delete id="deleteQcCheckTaskUserByBelongTos" parameterType="String">
|
||||
delete from qc_check_task_user where belong_to in
|
||||
<foreach item="belongTo" collection="Array" open="(" separator="," close=")">
|
||||
#{belongTo}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue