zss
2023-09-09 d11807a7506cd560df0a22bd712494df381f2bf6
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?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.yuanchu.mom.mapper.TechnologyTemplateMapper">
    <update id="delAllTech">
        update mom_ocean.technology_template
        set state=0
        where id in (${ids})
    </update>
 
    <!--查询工艺路线列表  左边二级展示-->
    <resultMap id="selectAllTechTemMap" type="map">
        <id property="name" column="elname"/>
        <collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
    </resultMap>
    <resultMap id="selectAllTechTemTowMap" type="map">
        <result property="name" column="father"/>
    </resultMap>
    <select id="selectAllTechTem" resultMap="selectAllTechTemMap">
        select e.name elname,
        father
        from mom_ocean.technology_template t,
        mom_ocean.element e,
        mom_ocean.element_technology et
        where e.id = et.element_id
        and t.id = tech_tem_id
        and t.state = 1
        and et.state=1
        and type=#{type}
        <if test="message!=null and message!=''">
            and father like concat('%',#{message},'%')
        </if>
    </select>
 
    <!--查询工艺路线列表 右边展示工艺和设备-->
    <select id="selectAllTechNam" resultType="java.util.Map">
        select id,
               name,
               device_group
        from mom_ocean.technology_template
        where state = 1
          and father = #{father}
    </select>
 
    <!--新增工艺路线 选择工序-->
    <select id="chooseTech" resultType="java.lang.String">
        select distinct father
        from mom_ocean.technology_template
        where state = 1
    </select>
 
    <!--根据id查看详情-->
    <resultMap id="selecTechByIdMap" type="map">
        <id property="type" column="type"/>
        <result property="father" column="father"/>
        <result property="name" column="name"/>
        <result property="deviceGroup" column="device_group"/>
        <collection property="children" resultMap="selecTechByIdsMap" javaType="List"/>
    </resultMap>
    <resultMap id="selecTechByIdsMap" type="map">
        <id property="id" column="id"/>
    </resultMap>
    <select id="selecTechById" resultMap="selecTechByIdMap">
        select e.id,
               father,
               t.name,
               type,
               device_group
        from mom_ocean.technology_template t,
             mom_ocean.element e,
             mom_ocean.element_technology et
        where e.id = et.element_id
          and t.id = tech_tem_id
          and t.state = 1
          and t.id = #{id}
    </select>
</mapper>