zhangherong
2025-06-12 6abc1a2fb78003bb1ea6283d813b8ccc0bcd9b2b
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
<?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="org.jeecg.modules.base.mapper.ProductionLineWarehouseClientMapper">
 
    <delete id="deleteByMainId" parameterType="java.lang.String">
        DELETE
        FROM  mom_base_production_line_warehouse_client
        WHERE
             warehouse_id = #{mainId}
    </delete>
 
    <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.base.entity.ProductionLineWarehouseClient">
        SELECT *
        FROM  mom_base_production_line_warehouse_client
        WHERE
             warehouse_id = #{mainId}
    </select>
    <select id="getFactoryList" resultType="Map">
        select
        t1.id id,
        t1.code code,
        t1.name name
        from mom_base_factory_model t1
        left join(select * from mom_base_factory_element_category where del_flag = 0) t2
        on t1.factory_element_category_id= t2.id
        left join (select * from sys_depart where del_flag = 0) t3
        on t1.depart_id = t3.id
        left join (select * from mom_sys_data_version where business_type='工厂建模' and del_flag=0) t4
        on t1.data_version_id = t4.id
        left join (select * from mom_base_factory_model where del_flag = 0) t5
        on t1.parent_id = t5.id
        where t1.del_flag = 0
        and t1.version = #{version}
        <if test="parentIds != null and parentIds.size > 0">
            and t1.parent_id in
            <foreach collection="parentIds" open="(" separator="," close=")" item="parentId">
                #{parentId}
            </foreach>
        </if>
        <if test="ids != null and ids.size > 0">
            and t1.id not in
            <foreach collection="ids" open="(" separator="," close=")" item="id">
                #{id}
            </foreach>
        </if>
        and t2.name != '工厂'
        and t2.name != '车间'
    </select>
</mapper>