소스 검색

修改拉取p2数据

zhuzeyu 1 년 전
부모
커밋
32d7f01020

+ 24 - 0
src/main/java/cn/ezhizao/project/business/domain/BizProductionPlanDetail.java

@@ -2,6 +2,7 @@ package cn.ezhizao.project.business.domain;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
@@ -390,4 +391,27 @@ public class BizProductionPlanDetail extends BaseEntity {
     @TableField(exist = false)
     private Boolean pullP2PlanDetails;
 
+
+    @TableField(exist = false)
+    private String keywords;
+
+    /** 累计投产量 */
+    @TableField(exist = false)
+    private Double pickUpQuantity;
+
+    /** 累计投产批数 */
+    @TableField(exist = false)
+    private Double lotTotalNumber;
+
+    /** 工段id */
+    @TableField(exist = false)
+    private Long deptId;
+
+
+    /** 待投产批数 */
+    @TableField(exist = false)
+    private Integer dayWorkLot;
+    /** 投产部门名称 */
+    @TableField(exist = false)
+    private String requisitionDepartmentName;
 }

+ 13 - 1
src/main/resources/mybatis/business/BizProductionPlanDetailMapper.xml

@@ -6,9 +6,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <resultMap type="cn.ezhizao.project.business.domain.BizProductionPlanDetail" id="BizProductionPlanDetailResult">
         <id column="id" property="id" />
+        <result column="requisition_department_id" property="requisitionDepartmentId"/>
+        <association property="requisitionDepartmentName" javaType="java.lang.String" column="requisition_department_id" select="getRequisitionDepartmentName"/>
+        <association property="pickUpQuantity" javaType="java.lang.String" column="id" select="getPickUpQuantity"/>
+        <association property="lotTotalNumber" javaType="java.lang.String" column="id" select="getLotTotalNumber"/>
     </resultMap>
+    <select id="getRequisitionDepartmentName" resultType="java.lang.String">
+        select dept_name from sys_dept where dept_id = #{requisitionDepartmentId}
+    </select>
+    <select id="getPickUpQuantity" resultType="java.lang.Double" >
+        SELECT sum(production_quantity) as pickUpQuantity from biz_production_plan_detail_sub_detail where production_plan_detail_id = #{id} and deleted = 0
+    </select>
 
-
+    <select id="getLotTotalNumber" resultType="java.lang.Double" >
+        SELECT sum(lot_number) as lotTotalNumber from biz_production_plan_detail_sub_detail where production_plan_detail_id = #{id} and deleted = 0
+    </select>
     <select id="getList" parameterType="BizProductionPlanDetail" resultMap="BizProductionPlanDetailResult">
         SELECT * FROM biz_production_plan_detail
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">