Browse Source

sop调整

车车 10 months ago
parent
commit
da4ce6a1a9

+ 6 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsSop.java

@@ -67,4 +67,10 @@ public class IsSop extends BaseBean
     @ApiModelProperty(value = "权重序号")
     private Integer sopIndex;
 
+    @ApiModelProperty(value = "所属岗位ID")
+    private Long workstationId;
+
+    @ApiModelProperty(value = "设备工艺ID")
+    private Long technologyId;
+
 }

+ 6 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/sop/PageSopDTO.java

@@ -39,4 +39,10 @@ public class PageSopDTO implements Serializable {
     @ApiModelProperty(value = "结束时间")
     private String endTime;
 
+    @ApiModelProperty(value = "所属岗位ID")
+    private Long workstationId;
+
+    @ApiModelProperty(value = "设备工艺ID")
+    private Long technologyId;
+
 }

+ 12 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/sop/SopPageVO.java

@@ -56,4 +56,16 @@ public class SopPageVO extends BaseBean
     @ApiModelProperty(value = "权重序号")
     private Integer sopIndex;
 
+    @ApiModelProperty(value = "所属岗位ID")
+    private Long workstationId;
+
+    @ApiModelProperty(value = "所属岗位Name")
+    private String workstationName;
+
+    @ApiModelProperty(value = "设备工艺ID")
+    private Long technologyId;
+
+    @ApiModelProperty(value = "设备工艺Name")
+    private String technologyName;
+
 }

+ 0 - 10
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsSopServiceImpl.java

@@ -244,16 +244,6 @@ public class IsSopServiceImpl extends ServiceImpl<IsSopMapper, IsSop> implements
 
     @Override
     public Page<SopPageVO> getIsSopPage(Page<IsSop> page, PageSopDTO dto) {
-        /*Page<IsSop> result = page(page, Wrappers.<IsSop>lambdaQuery()
-                .like(StringUtils.isNotBlank(dto.getSopCode()), IsSop::getSopCode, dto.getSopCode())
-                .like(StringUtils.isNotBlank(dto.getSopName()), IsSop::getSopName, dto.getSopName())
-                .eq(StringUtils.isNotBlank(dto.getSopStatus()), IsSop::getSopStatus, dto.getSopStatus())
-                .eq(dto.getWorkshopId() != null, IsSop::getWorkshopId, dto.getWorkshopId())
-                .eq(dto.getWorkareaId() != null, IsSop::getWorkareaId, dto.getWorkareaId())
-                .eq(StringUtils.isNotBlank(dto.getSopType()), IsSop::getSopType, dto.getSopType())
-                .ge(StringUtils.isNotBlank(dto.getStartTime()), IsSop::getCreateTime, dto.getStartTime())
-                .le(StringUtils.isNotBlank(dto.getEndTime()), IsSop::getCreateTime, dto.getEndTime())
-                .orderByDesc(IsSop::getSopId));*/
         return isSopMapper.getIsSopPage(page, dto);
     }
 

+ 11 - 18
ktg-iscs/src/main/resources/mapper/IsSopMapper.xml

@@ -4,28 +4,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ktg.iscs.mapper.IsSopMapper">
 
-    <resultMap type="IsSop" id="IsSopResult">
-        <result property="sopId"    column="sop_id"    />
-        <result property="sopCode"    column="sop_code"    />
-        <result property="sopName"    column="sop_name"    />
-        <result property="sopType"    column="sop_type"    />
-        <result property="workshopId"    column="workshop_id"    />
-        <result property="workareaId"    column="workarea_id"    />
-        <result property="sopContent"    column="sop_content"    />
-        <result property="sopStatus"    column="sop_status"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="sopIndex"    column="sop_index"    />
-    </resultMap>
-
     <sql id="selectIsSopVo">
         select * from is_sop
     </sql>
 
-    <select id="selectIsSopList" parameterType="IsSop" resultMap="IsSopResult">
+    <select id="selectIsSopList" parameterType="IsSop" resultType="IsSop">
         <include refid="selectIsSopVo"/>
         <where>
             <if test="sopCode != null  and sopCode != ''"> and sop_code = #{sopCode}</if>
@@ -114,11 +97,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             s.*,
             ws.workshop_name,
             wa.workarea_name,
+            wn.workstation_name,
+            d.technology_name,
             COUNT( p.record_id ) AS pointCount
         FROM
             is_sop s
             LEFT JOIN md_workshop ws ON ws.workshop_id = s.workshop_id
             LEFT JOIN is_workarea wa ON wa.workarea_id = s.workarea_id
+            LEFT JOIN is_workstation wn ON wn.workstation_id = s.workstation_id
+            LEFT JOIN is_device_technology d ON d.technology_id = s.technology_id
             LEFT JOIN is_sop_points p ON p.sop_id = s.sop_id
         <where>
             <if test="dto.sopCode != null and dto.sopCode.trim != ''">
@@ -145,6 +132,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dto.endTime != null and dto.endTime.trim != ''">
                 and s.create_time &lt;= #{dto.endTime}
             </if>
+            <if test="dto.workstationId != null">
+                and s.workstation_id = #{dto.workstationId}
+            </if>
+            <if test="dto.technologyId != null">
+                and s.technology_id = #{dto.technologyId}
+            </if>
         </where>
         GROUP BY s.sop_id
         ORDER BY s.sop_index ASC, s.sop_id DESC