李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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.chinaztt.mes.production.mapper.HandymanTemplateMapper">
 
    <resultMap id="handymanTemplateMap" type="com.chinaztt.mes.production.dto.HandymanTemplateDTO">
        <id property="id" column="id"/>
        <result property="templateNo" column="template_no"/>
        <result property="templateDescription" column="template_description"/>
        <result property="remark" column="remark"/>
        <result property="workstationId" column="workstation_id"/>
    </resultMap>
 
    <select id="getList" resultMap="handymanTemplateMap">
        select distinct pht.*
        from production_handyman_template pht
        left join basic_join_workstation_template bjwt on bjwt.handyman_template_id=pht."id"
        <if test="ew.emptyOfWhere == false">
            ${ew.customSqlSegment}
        </if>
    </select>
 
 
    <select id="getProductionHandymanTemplateByWorkstation" resultMap="handymanTemplateMap">
        select distinct pht.*
        from production_handyman_template pht
        left join basic_join_workstation_template bjwt on bjwt.handyman_template_id=pht."id"
        where bjwt.workstation_id in
        <foreach collection="workstationIdList" item="id" index="index" open="(" close=")" separator=",">
            #{id}
        </foreach>
    </select>
</mapper>