From 19f65cce1297bee2ed4f5be518532a55de98f589 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期四, 17 四月 2025 15:44:13 +0800
Subject: [PATCH] 工单同步表基础代码类

---
 aps-modules/aps-job/src/main/java/com/aps/job/service/IApsWorkOrderJobService.java         |   61 +++
 aps-modules/aps-job/src/main/resources/mapper/job/ApsWorkOrderJobMapper.xml                |  262 ++++++++++++++++
 aps-modules/aps-job/src/main/java/com/aps/job/mapper/ApsWorkOrderJobMapper.java            |   66 ++++
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateProcessStatMapper.xml          |    1 
 aps-modules/aps-job/src/main/java/com/aps/job/domain/ApsWorkOrderJob.java                  |  417 ++++++++++++++++++++++++++
 aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWorkOrderJobServiceImpl.java |   96 ++++++
 6 files changed, 903 insertions(+), 0 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateProcessStatMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateProcessStatMapper.xml
index aadf427..238db8f 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateProcessStatMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateProcessStatMapper.xml
@@ -48,6 +48,7 @@
             <if test="designTimes != null "> and design_times = #{designTimes}</if>
             <if test="batchNumber != null  and batchNumber != ''"> and batch_number = #{batchNumber}</if>
         </where>
+        order by work_order_no asc,num desc
     </select>
     
     <select id="selectApsPlateProcessStatById" parameterType="String" resultMap="ApsPlateProcessStatResult">
diff --git a/aps-modules/aps-job/src/main/java/com/aps/job/domain/ApsWorkOrderJob.java b/aps-modules/aps-job/src/main/java/com/aps/job/domain/ApsWorkOrderJob.java
new file mode 100644
index 0000000..0bc7a35
--- /dev/null
+++ b/aps-modules/aps-job/src/main/java/com/aps/job/domain/ApsWorkOrderJob.java
@@ -0,0 +1,417 @@
+package com.aps.job.domain;
+
+import java.math.BigDecimal;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.aps.common.core.annotation.Excel;
+import com.aps.common.core.web.domain.BaseEntity;
+
+/**
+ * 宸ュ崟鍚屾瀵硅薄 aps_work_order_job
+ * 
+ * @author zhl
+ * @date 2025-04-17
+ */
+public class ApsWorkOrderJob extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 涓婚敭id */
+    private Long id;
+
+    /** 鍚屾涓婚敭 */
+    @Excel(name = "鍚屾涓婚敭")
+    private String orderId;
+
+    /** 鍗曟嵁鍙� */
+    @Excel(name = "鍗曟嵁鍙�")
+    private String docNo;
+
+    /** 涓讳欢鏂欏彿 */
+    @Excel(name = "涓讳欢鏂欏彿")
+    private String mainitemCode;
+
+    /** 涓讳欢鍥惧彿 */
+    @Excel(name = "涓讳欢鍥惧彿")
+    private String mainitemFigure;
+
+    /** 瀹㈡埛鍚嶇О */
+    @Excel(name = "瀹㈡埛鍚嶇О")
+    private String customerName;
+
+    /** 涓氬姟绫诲瀷 0锛氳鍒掕鍗�  1锛氱敓浜ц鍗� */
+    @Excel(name = "涓氬姟绫诲瀷 0锛氳鍒掕鍗�  1锛氱敓浜ц鍗�")
+    private Integer businessType;
+
+    /** 闇�姹傚垎绫� */
+    @Excel(name = "闇�姹傚垎绫�")
+    private String demandType;
+
+    /** 鍗曟嵁鐘舵��( 0锛氬紑绔� 1锛氬凡鏍稿噯 2锛氬紑宸� 3锛氬畬宸� 4锛氭牳鍑嗕腑 5锛氫綔搴� ) */
+    @Excel(name = "鍗曟嵁鐘舵��( 0锛氬紑绔� 1锛氬凡鏍稿噯 2锛氬紑宸� 3锛氬畬宸� 4锛氭牳鍑嗕腑 5锛氫綔搴� )")
+    private Long docStatus;
+
+    /** 鏂欏彿 */
+    @Excel(name = "鏂欏彿")
+    private String itemCode;
+
+    /** 鍥惧彿 */
+    @Excel(name = "鍥惧彿")
+    private String itemFigure;
+
+    /** 鐗堟湰鍙� */
+    @Excel(name = "鐗堟湰鍙�")
+    private String itemFigureVersion;
+
+    /** 鐢熶骇鏁伴噺 */
+    @Excel(name = "鐢熶骇鏁伴噺")
+    private BigDecimal pruductQty;
+
+    /** 鑹搧鏁伴噺 */
+    @Excel(name = "鑹搧鏁伴噺")
+    private BigDecimal workQty;
+
+    /** 宸ュ簭鍙� */
+    @Excel(name = "宸ュ簭鍙�")
+    private String opNum;
+
+    /** 宸ヤ綔涓績 褰撳墠鍦ㄥ埗鐨勫伐搴� */
+    @Excel(name = "宸ヤ綔涓績 褰撳墠鍦ㄥ埗鐨勫伐搴�")
+    private Integer workCenter;
+
+    /** 鎵�灞為儴闂� */
+    @Excel(name = "鎵�灞為儴闂�")
+    private String dept;
+
+    /** 璁″垝寮�宸ユ棩 */
+    @Excel(name = "璁″垝寮�宸ユ棩")
+    private String startDate;
+
+    /** 璁″垝瀹屽伐鏃� */
+    @Excel(name = "璁″垝瀹屽伐鏃�")
+    private String completeDate;
+
+    /** 涓嬮亾宸ュ簭鎵�灞為儴闂� */
+    @Excel(name = "涓嬮亾宸ュ簭鎵�灞為儴闂�")
+    private String nextDept;
+
+    /** 鏄惁鎸傝捣 1锛氭槸     0:鍚� */
+    @Excel(name = "鏄惁鎸傝捣 1锛氭槸     0:鍚�")
+    private Integer isHoldRelease;
+
+    /** 澶栧崗鏍囪瘑 */
+    @Excel(name = "澶栧崗鏍囪瘑")
+    private String isOutSource;
+
+    /** 璐﹀( 鏋氫妇銆庡崡閫�/娌堥槼銆�) */
+    @Excel(name = "璐﹀( 鏋氫妇銆庡崡閫�/娌堥槼銆�)")
+    private String org;
+
+    /** 椤电爜 */
+    @Excel(name = "椤电爜")
+    private Integer pageNum;
+
+    /** 椤甸潰绗嚑鏉℃暟鎹� */
+    @Excel(name = "椤甸潰绗嚑鏉℃暟鎹�")
+    private Integer pageIndex;
+
+    /** 鍒犻櫎鏍囧織锛�0浠h〃瀛樺湪 2浠h〃鍒犻櫎锛� */
+    @Excel(name = "鍒犻櫎鏍囧織", readConverterExp = "0=浠h〃瀛樺湪,2=浠h〃鍒犻櫎")
+    private String delFlag;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+
+    public void setOrderId(String orderId) 
+    {
+        this.orderId = orderId;
+    }
+
+    public String getOrderId() 
+    {
+        return orderId;
+    }
+
+    public void setDocNo(String docNo) 
+    {
+        this.docNo = docNo;
+    }
+
+    public String getDocNo() 
+    {
+        return docNo;
+    }
+
+    public void setMainitemCode(String mainitemCode) 
+    {
+        this.mainitemCode = mainitemCode;
+    }
+
+    public String getMainitemCode() 
+    {
+        return mainitemCode;
+    }
+
+    public void setMainitemFigure(String mainitemFigure) 
+    {
+        this.mainitemFigure = mainitemFigure;
+    }
+
+    public String getMainitemFigure() 
+    {
+        return mainitemFigure;
+    }
+
+    public void setCustomerName(String customerName) 
+    {
+        this.customerName = customerName;
+    }
+
+    public String getCustomerName() 
+    {
+        return customerName;
+    }
+
+    public void setBusinessType(Integer businessType) 
+    {
+        this.businessType = businessType;
+    }
+
+    public Integer getBusinessType() 
+    {
+        return businessType;
+    }
+
+    public void setDemandType(String demandType) 
+    {
+        this.demandType = demandType;
+    }
+
+    public String getDemandType() 
+    {
+        return demandType;
+    }
+
+    public void setDocStatus(Long docStatus) 
+    {
+        this.docStatus = docStatus;
+    }
+
+    public Long getDocStatus() 
+    {
+        return docStatus;
+    }
+
+    public void setItemCode(String itemCode) 
+    {
+        this.itemCode = itemCode;
+    }
+
+    public String getItemCode() 
+    {
+        return itemCode;
+    }
+
+    public void setItemFigure(String itemFigure) 
+    {
+        this.itemFigure = itemFigure;
+    }
+
+    public String getItemFigure() 
+    {
+        return itemFigure;
+    }
+
+    public void setItemFigureVersion(String itemFigureVersion) 
+    {
+        this.itemFigureVersion = itemFigureVersion;
+    }
+
+    public String getItemFigureVersion() 
+    {
+        return itemFigureVersion;
+    }
+
+    public void setPruductQty(BigDecimal pruductQty) 
+    {
+        this.pruductQty = pruductQty;
+    }
+
+    public BigDecimal getPruductQty() 
+    {
+        return pruductQty;
+    }
+
+    public void setWorkQty(BigDecimal workQty) 
+    {
+        this.workQty = workQty;
+    }
+
+    public BigDecimal getWorkQty() 
+    {
+        return workQty;
+    }
+
+    public void setOpNum(String opNum) 
+    {
+        this.opNum = opNum;
+    }
+
+    public String getOpNum() 
+    {
+        return opNum;
+    }
+
+    public void setWorkCenter(Integer workCenter) 
+    {
+        this.workCenter = workCenter;
+    }
+
+    public Integer getWorkCenter() 
+    {
+        return workCenter;
+    }
+
+    public void setDept(String dept) 
+    {
+        this.dept = dept;
+    }
+
+    public String getDept() 
+    {
+        return dept;
+    }
+
+    public void setStartDate(String startDate) 
+    {
+        this.startDate = startDate;
+    }
+
+    public String getStartDate() 
+    {
+        return startDate;
+    }
+
+    public void setCompleteDate(String completeDate) 
+    {
+        this.completeDate = completeDate;
+    }
+
+    public String getCompleteDate() 
+    {
+        return completeDate;
+    }
+
+    public void setNextDept(String nextDept) 
+    {
+        this.nextDept = nextDept;
+    }
+
+    public String getNextDept() 
+    {
+        return nextDept;
+    }
+
+    public void setIsHoldRelease(Integer isHoldRelease) 
+    {
+        this.isHoldRelease = isHoldRelease;
+    }
+
+    public Integer getIsHoldRelease() 
+    {
+        return isHoldRelease;
+    }
+
+    public void setIsOutSource(String isOutSource) 
+    {
+        this.isOutSource = isOutSource;
+    }
+
+    public String getIsOutSource() 
+    {
+        return isOutSource;
+    }
+
+    public void setOrg(String org) 
+    {
+        this.org = org;
+    }
+
+    public String getOrg() 
+    {
+        return org;
+    }
+
+    public void setPageNum(Integer pageNum) 
+    {
+        this.pageNum = pageNum;
+    }
+
+    public Integer getPageNum() 
+    {
+        return pageNum;
+    }
+
+    public void setPageIndex(Integer pageIndex) 
+    {
+        this.pageIndex = pageIndex;
+    }
+
+    public Integer getPageIndex() 
+    {
+        return pageIndex;
+    }
+
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("orderId", getOrderId())
+            .append("docNo", getDocNo())
+            .append("mainitemCode", getMainitemCode())
+            .append("mainitemFigure", getMainitemFigure())
+            .append("customerName", getCustomerName())
+            .append("businessType", getBusinessType())
+            .append("demandType", getDemandType())
+            .append("docStatus", getDocStatus())
+            .append("itemCode", getItemCode())
+            .append("itemFigure", getItemFigure())
+            .append("itemFigureVersion", getItemFigureVersion())
+            .append("pruductQty", getPruductQty())
+            .append("workQty", getWorkQty())
+            .append("opNum", getOpNum())
+            .append("workCenter", getWorkCenter())
+            .append("dept", getDept())
+            .append("startDate", getStartDate())
+            .append("completeDate", getCompleteDate())
+            .append("nextDept", getNextDept())
+            .append("isHoldRelease", getIsHoldRelease())
+            .append("isOutSource", getIsOutSource())
+            .append("org", getOrg())
+            .append("pageNum", getPageNum())
+            .append("pageIndex", getPageIndex())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}
diff --git a/aps-modules/aps-job/src/main/java/com/aps/job/mapper/ApsWorkOrderJobMapper.java b/aps-modules/aps-job/src/main/java/com/aps/job/mapper/ApsWorkOrderJobMapper.java
new file mode 100644
index 0000000..765c1ad
--- /dev/null
+++ b/aps-modules/aps-job/src/main/java/com/aps/job/mapper/ApsWorkOrderJobMapper.java
@@ -0,0 +1,66 @@
+package com.aps.job.mapper;
+
+import java.util.List;
+import com.aps.job.domain.ApsWorkOrderJob;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 宸ュ崟鍚屾Mapper鎺ュ彛
+ * 
+ * @author zhl
+ * @date 2025-04-17
+ */
+@Mapper
+public interface ApsWorkOrderJobMapper 
+{
+    /**
+     * 鏌ヨ宸ュ崟鍚屾
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 宸ュ崟鍚屾
+     */
+    public ApsWorkOrderJob selectApsWorkOrderJobById(Long id);
+
+    /**
+     * 鏌ヨ宸ュ崟鍚屾鍒楄〃
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 宸ュ崟鍚屾闆嗗悎
+     */
+    public List<ApsWorkOrderJob> selectApsWorkOrderJobList(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 鏂板宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    public int insertApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 淇敼宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    public int updateApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 鍒犻櫎宸ュ崟鍚屾
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 缁撴灉
+     */
+    public int deleteApsWorkOrderJobById(Long id);
+
+    /**
+     * 鎵归噺鍒犻櫎宸ュ崟鍚屾
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+     * @return 缁撴灉
+     */
+    public int deleteApsWorkOrderJobByIds(Long[] ids);
+
+    void batchInsertApsWorkOrderJob(List<ApsWorkOrderJob> jobs);
+
+}
diff --git a/aps-modules/aps-job/src/main/java/com/aps/job/service/IApsWorkOrderJobService.java b/aps-modules/aps-job/src/main/java/com/aps/job/service/IApsWorkOrderJobService.java
new file mode 100644
index 0000000..283fced
--- /dev/null
+++ b/aps-modules/aps-job/src/main/java/com/aps/job/service/IApsWorkOrderJobService.java
@@ -0,0 +1,61 @@
+package com.aps.job.service;
+
+import java.util.List;
+import com.aps.job.domain.ApsWorkOrderJob;
+
+/**
+ * 宸ュ崟鍚屾Service鎺ュ彛
+ * 
+ * @author zhl
+ * @date 2025-04-17
+ */
+public interface IApsWorkOrderJobService 
+{
+    /**
+     * 鏌ヨ宸ュ崟鍚屾
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 宸ュ崟鍚屾
+     */
+    public ApsWorkOrderJob selectApsWorkOrderJobById(Long id);
+
+    /**
+     * 鏌ヨ宸ュ崟鍚屾鍒楄〃
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 宸ュ崟鍚屾闆嗗悎
+     */
+    public List<ApsWorkOrderJob> selectApsWorkOrderJobList(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 鏂板宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    public int insertApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 淇敼宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    public int updateApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob);
+
+    /**
+     * 鎵归噺鍒犻櫎宸ュ崟鍚屾
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑宸ュ崟鍚屾涓婚敭闆嗗悎
+     * @return 缁撴灉
+     */
+    public int deleteApsWorkOrderJobByIds(Long[] ids);
+
+    /**
+     * 鍒犻櫎宸ュ崟鍚屾淇℃伅
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 缁撴灉
+     */
+    public int deleteApsWorkOrderJobById(Long id);
+}
diff --git a/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWorkOrderJobServiceImpl.java b/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWorkOrderJobServiceImpl.java
new file mode 100644
index 0000000..82927a6
--- /dev/null
+++ b/aps-modules/aps-job/src/main/java/com/aps/job/service/impl/ApsWorkOrderJobServiceImpl.java
@@ -0,0 +1,96 @@
+package com.aps.job.service.impl;
+
+import java.util.List;
+import com.aps.common.core.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.aps.job.mapper.ApsWorkOrderJobMapper;
+import com.aps.job.domain.ApsWorkOrderJob;
+import com.aps.job.service.IApsWorkOrderJobService;
+
+/**
+ * 宸ュ崟鍚屾Service涓氬姟灞傚鐞�
+ * 
+ * @author zhl
+ * @date 2025-04-17
+ */
+@Service
+public class ApsWorkOrderJobServiceImpl implements IApsWorkOrderJobService 
+{
+    @Autowired
+    private ApsWorkOrderJobMapper apsWorkOrderJobMapper;
+
+    /**
+     * 鏌ヨ宸ュ崟鍚屾
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 宸ュ崟鍚屾
+     */
+    @Override
+    public ApsWorkOrderJob selectApsWorkOrderJobById(Long id)
+    {
+        return apsWorkOrderJobMapper.selectApsWorkOrderJobById(id);
+    }
+
+    /**
+     * 鏌ヨ宸ュ崟鍚屾鍒楄〃
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 宸ュ崟鍚屾
+     */
+    @Override
+    public List<ApsWorkOrderJob> selectApsWorkOrderJobList(ApsWorkOrderJob apsWorkOrderJob)
+    {
+        return apsWorkOrderJobMapper.selectApsWorkOrderJobList(apsWorkOrderJob);
+    }
+
+    /**
+     * 鏂板宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    @Override
+    public int insertApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob)
+    {
+        apsWorkOrderJob.setCreateTime(DateUtils.getNowDate());
+        return apsWorkOrderJobMapper.insertApsWorkOrderJob(apsWorkOrderJob);
+    }
+
+    /**
+     * 淇敼宸ュ崟鍚屾
+     * 
+     * @param apsWorkOrderJob 宸ュ崟鍚屾
+     * @return 缁撴灉
+     */
+    @Override
+    public int updateApsWorkOrderJob(ApsWorkOrderJob apsWorkOrderJob)
+    {
+        apsWorkOrderJob.setUpdateTime(DateUtils.getNowDate());
+        return apsWorkOrderJobMapper.updateApsWorkOrderJob(apsWorkOrderJob);
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎宸ュ崟鍚屾
+     * 
+     * @param ids 闇�瑕佸垹闄ょ殑宸ュ崟鍚屾涓婚敭
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteApsWorkOrderJobByIds(Long[] ids)
+    {
+        return apsWorkOrderJobMapper.deleteApsWorkOrderJobByIds(ids);
+    }
+
+    /**
+     * 鍒犻櫎宸ュ崟鍚屾淇℃伅
+     * 
+     * @param id 宸ュ崟鍚屾涓婚敭
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteApsWorkOrderJobById(Long id)
+    {
+        return apsWorkOrderJobMapper.deleteApsWorkOrderJobById(id);
+    }
+}
diff --git a/aps-modules/aps-job/src/main/resources/mapper/job/ApsWorkOrderJobMapper.xml b/aps-modules/aps-job/src/main/resources/mapper/job/ApsWorkOrderJobMapper.xml
new file mode 100644
index 0000000..1c37d2c
--- /dev/null
+++ b/aps-modules/aps-job/src/main/resources/mapper/job/ApsWorkOrderJobMapper.xml
@@ -0,0 +1,262 @@
+<?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.aps.job.mapper.ApsWorkOrderJobMapper">
+    
+    <resultMap type="ApsWorkOrderJob" id="ApsWorkOrderJobResult">
+        <result property="id"    column="id"    />
+        <result property="orderId"    column="order_id"    />
+        <result property="docNo"    column="doc_no"    />
+        <result property="mainitemCode"    column="mainitem_code"    />
+        <result property="mainitemFigure"    column="mainitem_figure"    />
+        <result property="customerName"    column="customer_name"    />
+        <result property="businessType"    column="business_type"    />
+        <result property="demandType"    column="demand_type"    />
+        <result property="docStatus"    column="doc_status"    />
+        <result property="itemCode"    column="item_code"    />
+        <result property="itemFigure"    column="item_figure"    />
+        <result property="itemFigureVersion"    column="item_figure_version"    />
+        <result property="pruductQty"    column="pruduct_qty"    />
+        <result property="workQty"    column="work_qty"    />
+        <result property="opNum"    column="op_num"    />
+        <result property="workCenter"    column="work_center"    />
+        <result property="dept"    column="dept"    />
+        <result property="startDate"    column="start_date"    />
+        <result property="completeDate"    column="complete_date"    />
+        <result property="nextDept"    column="next_dept"    />
+        <result property="isHoldRelease"    column="is_hold_release"    />
+        <result property="isOutSource"    column="is_out_source"    />
+        <result property="org"    column="org"    />
+        <result property="pageNum"    column="page_num"    />
+        <result property="pageIndex"    column="page_index"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectApsWorkOrderJobVo">
+        select id, order_id, doc_no, mainitem_code, mainitem_figure, customer_name, business_type, demand_type, doc_status, item_code, item_figure, item_figure_version, pruduct_qty, work_qty, op_num, work_center, dept, start_date, complete_date, next_dept, is_hold_release, is_out_source, org, page_num, page_index, del_flag, create_by, create_time, update_by, update_time from aps_work_order_job
+    </sql>
+
+    <select id="selectApsWorkOrderJobList" parameterType="ApsWorkOrderJob" resultMap="ApsWorkOrderJobResult">
+        <include refid="selectApsWorkOrderJobVo"/>
+        <where>  
+            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
+            <if test="docNo != null  and docNo != ''"> and doc_no = #{docNo}</if>
+            <if test="mainitemCode != null  and mainitemCode != ''"> and mainitem_code = #{mainitemCode}</if>
+            <if test="mainitemFigure != null  and mainitemFigure != ''"> and mainitem_figure = #{mainitemFigure}</if>
+            <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
+            <if test="businessType != null "> and business_type = #{businessType}</if>
+            <if test="demandType != null  and demandType != ''"> and demand_type = #{demandType}</if>
+            <if test="docStatus != null "> and doc_status = #{docStatus}</if>
+            <if test="itemCode != null  and itemCode != ''"> and item_code = #{itemCode}</if>
+            <if test="itemFigure != null  and itemFigure != ''"> and item_figure = #{itemFigure}</if>
+            <if test="itemFigureVersion != null  and itemFigureVersion != ''"> and item_figure_version = #{itemFigureVersion}</if>
+            <if test="pruductQty != null "> and pruduct_qty = #{pruductQty}</if>
+            <if test="workQty != null "> and work_qty = #{workQty}</if>
+            <if test="opNum != null  and opNum != ''"> and op_num = #{opNum}</if>
+            <if test="workCenter != null "> and work_center = #{workCenter}</if>
+            <if test="dept != null  and dept != ''"> and dept = #{dept}</if>
+            <if test="startDate != null  and startDate != ''"> and start_date = #{startDate}</if>
+            <if test="completeDate != null  and completeDate != ''"> and complete_date = #{completeDate}</if>
+            <if test="nextDept != null  and nextDept != ''"> and next_dept = #{nextDept}</if>
+            <if test="isHoldRelease != null "> and is_hold_release = #{isHoldRelease}</if>
+            <if test="isOutSource != null  and isOutSource != ''"> and is_out_source = #{isOutSource}</if>
+            <if test="org != null  and org != ''"> and org = #{org}</if>
+            <if test="pageNum != null "> and page_num = #{pageNum}</if>
+            <if test="pageIndex != null "> and page_index = #{pageIndex}</if>
+            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
+        </where>
+    </select>
+    
+    <select id="selectApsWorkOrderJobById" parameterType="Long" resultMap="ApsWorkOrderJobResult">
+        <include refid="selectApsWorkOrderJobVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertApsWorkOrderJob" parameterType="ApsWorkOrderJob" useGeneratedKeys="true" keyProperty="id">
+        insert into aps_work_order_job
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="orderId != null">order_id,</if>
+            <if test="docNo != null">doc_no,</if>
+            <if test="mainitemCode != null">mainitem_code,</if>
+            <if test="mainitemFigure != null">mainitem_figure,</if>
+            <if test="customerName != null">customer_name,</if>
+            <if test="businessType != null">business_type,</if>
+            <if test="demandType != null">demand_type,</if>
+            <if test="docStatus != null">doc_status,</if>
+            <if test="itemCode != null">item_code,</if>
+            <if test="itemFigure != null">item_figure,</if>
+            <if test="itemFigureVersion != null">item_figure_version,</if>
+            <if test="pruductQty != null">pruduct_qty,</if>
+            <if test="workQty != null">work_qty,</if>
+            <if test="opNum != null">op_num,</if>
+            <if test="workCenter != null">work_center,</if>
+            <if test="dept != null">dept,</if>
+            <if test="startDate != null">start_date,</if>
+            <if test="completeDate != null">complete_date,</if>
+            <if test="nextDept != null">next_dept,</if>
+            <if test="isHoldRelease != null">is_hold_release,</if>
+            <if test="isOutSource != null">is_out_source,</if>
+            <if test="org != null">org,</if>
+            <if test="pageNum != null">page_num,</if>
+            <if test="pageIndex != null">page_index,</if>
+            <if test="delFlag != null">del_flag,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="orderId != null">#{orderId},</if>
+            <if test="docNo != null">#{docNo},</if>
+            <if test="mainitemCode != null">#{mainitemCode},</if>
+            <if test="mainitemFigure != null">#{mainitemFigure},</if>
+            <if test="customerName != null">#{customerName},</if>
+            <if test="businessType != null">#{businessType},</if>
+            <if test="demandType != null">#{demandType},</if>
+            <if test="docStatus != null">#{docStatus},</if>
+            <if test="itemCode != null">#{itemCode},</if>
+            <if test="itemFigure != null">#{itemFigure},</if>
+            <if test="itemFigureVersion != null">#{itemFigureVersion},</if>
+            <if test="pruductQty != null">#{pruductQty},</if>
+            <if test="workQty != null">#{workQty},</if>
+            <if test="opNum != null">#{opNum},</if>
+            <if test="workCenter != null">#{workCenter},</if>
+            <if test="dept != null">#{dept},</if>
+            <if test="startDate != null">#{startDate},</if>
+            <if test="completeDate != null">#{completeDate},</if>
+            <if test="nextDept != null">#{nextDept},</if>
+            <if test="isHoldRelease != null">#{isHoldRelease},</if>
+            <if test="isOutSource != null">#{isOutSource},</if>
+            <if test="org != null">#{org},</if>
+            <if test="pageNum != null">#{pageNum},</if>
+            <if test="pageIndex != null">#{pageIndex},</if>
+            <if test="delFlag != null">#{delFlag},</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>
+         </trim>
+    </insert>
+
+    <update id="updateApsWorkOrderJob" parameterType="ApsWorkOrderJob">
+        update aps_work_order_job
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="orderId != null">order_id = #{orderId},</if>
+            <if test="docNo != null">doc_no = #{docNo},</if>
+            <if test="mainitemCode != null">mainitem_code = #{mainitemCode},</if>
+            <if test="mainitemFigure != null">mainitem_figure = #{mainitemFigure},</if>
+            <if test="customerName != null">customer_name = #{customerName},</if>
+            <if test="businessType != null">business_type = #{businessType},</if>
+            <if test="demandType != null">demand_type = #{demandType},</if>
+            <if test="docStatus != null">doc_status = #{docStatus},</if>
+            <if test="itemCode != null">item_code = #{itemCode},</if>
+            <if test="itemFigure != null">item_figure = #{itemFigure},</if>
+            <if test="itemFigureVersion != null">item_figure_version = #{itemFigureVersion},</if>
+            <if test="pruductQty != null">pruduct_qty = #{pruductQty},</if>
+            <if test="workQty != null">work_qty = #{workQty},</if>
+            <if test="opNum != null">op_num = #{opNum},</if>
+            <if test="workCenter != null">work_center = #{workCenter},</if>
+            <if test="dept != null">dept = #{dept},</if>
+            <if test="startDate != null">start_date = #{startDate},</if>
+            <if test="completeDate != null">complete_date = #{completeDate},</if>
+            <if test="nextDept != null">next_dept = #{nextDept},</if>
+            <if test="isHoldRelease != null">is_hold_release = #{isHoldRelease},</if>
+            <if test="isOutSource != null">is_out_source = #{isOutSource},</if>
+            <if test="org != null">org = #{org},</if>
+            <if test="pageNum != null">page_num = #{pageNum},</if>
+            <if test="pageIndex != null">page_index = #{pageIndex},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</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>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteApsWorkOrderJobById" parameterType="Long">
+        delete from aps_work_order_job where id = #{id}
+    </delete>
+
+    <delete id="deleteApsWorkOrderJobByIds" parameterType="String">
+        delete from aps_work_order_job where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="batchInsertApsWorkOrderJob" parameterType="java.util.List">
+        insert into aps_work_order_job
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            order_id,
+            doc_no,
+            mainitem_code,
+            mainitem_figure,
+            customer_name,
+            business_type,
+            demand_type,
+            doc_status,
+            item_code,
+            item_figure,
+            item_figure_version,
+            pruduct_qty,
+            work_qty,
+            op_num,
+            work_center,
+            dept,
+            start_date,
+            complete_date,
+            next_dept,
+            is_hold_release,
+            is_out_source,
+            org,
+            page_num,
+            page_index,
+            del_flag,
+            create_by,
+            create_time,
+            update_by,
+            update_time
+        </trim>
+        values
+        <foreach collection="list" item="job" separator=",">
+            (
+            #{job.orderId},
+            #{job.docNo},
+            #{job.mainitemCode},
+            #{job.mainitemFigure},
+            #{job.customerName},
+            #{job.businessType},
+            #{job.demandType},
+            #{job.docStatus},
+            #{job.itemCode},
+            #{job.itemFigure},
+            #{job.itemFigureVersion},
+            #{job.pruductQty},
+            #{job.workQty},
+            #{job.opNum},
+            #{job.workCenter},
+            #{job.dept},
+            #{job.startDate},
+            #{job.completeDate},
+            #{job.nextDept},
+            #{job.isHoldRelease},
+            #{job.isOutSource},
+            #{job.org},
+            #{job.pageNum},
+            #{job.pageIndex},
+            #{job.delFlag},
+            #{job.createBy},
+            #{job.createTime},
+            #{job.updateBy},
+            #{job.updateTime}
+            )
+        </foreach>
+    </insert>
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.3