Lius
2024-10-24 a7a4e0e6ae09c720e50dc22fc50c67519414067c
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
<?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.mdc.mapper.MdcComponentInfoMapper">
 
    <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcComponentInfo">
        SELECT
            t1.*,
            t2.production_name productionName
        FROM
            mdc_component_info t1
                LEFT JOIN mdc_production t2 ON t1.production_id = t2.id
        <where>
            <if test="mdcComponentInfo.componentName != null and mdcComponentInfo.componentName != ''">
                AND t1.component_name LIKE '%' + #{mdcComponentInfo.componentName} + '%'
            </if>
        </where>
    </select>
 
    <select id="findByComponentNo" resultType="org.jeecg.modules.mdc.entity.MdcComponentInfo">
        SELECT
            t1.*
        FROM
            mdc_component_info t1
                LEFT JOIN mdc_production_equipment t2 ON t1.beltline_id = t2.production_id
                LEFT JOIN mdc_equipment t3 ON t3.id = t2.equipment_id
        WHERE
            t1.component_no = #{productNo}
          AND t3.equipment_id = #{equipmentId}
    </select>
</mapper>