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
<?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.WorkCenterEquipmentMapper">
<select id="listByWorkCenterId" resultType="Map">
    select
    t1.id id,
    t2.id equipmentId,
    t2.num equipmentCode,
    t2.name equipmentName,
    t2.model equipmentModel,
    t2.equipment_category_id equipmentCategoryId,
    t2.standard equipmentStandard,
    t2.manufacturer equipmentManufacturer
    from
    mom_base_work_center_equipment t1
    left join (select * from mom_base_equipment where del_flag=0) t2
    on t1.equipment_id = t2.id
    where t1.work_center_id = #{workCenterId}
    and t1.del_flag = 0
</select>
    <select id="getAddEquipmentListByEquipmentCategoryId" resultType="Map">
        select
            id id,
            num equipmentCode,
            name equipmentName,
            model equipmentModel,
            equipment_category_id equipmentCategoryId,
            standard equipmentStandard,
            manufacturer equipmentManufacturer
        from
            mom_base_equipment
        where equipment_category_id = #{equipmentCategoryId}
        <if test="equipmentIdList != null and equipmentIdList.size > 0">
            and id not in (
            select id from mom_base_equipment where del_flag=0 and id in
            <foreach collection="equipmentIdList" open="(" separator="," close=")" item="equipId">
                #{equipId}
            </foreach>
            )
        </if>
          and del_flag = 0
    </select>
</mapper>