|
|
@@ -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 <= #{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
|