shenyijian
2024-06-21 f20611265f7d34fd4fbcdfdaff6cb9cccd0b25fc
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
<?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="cn.gistack.sm.sg.mapper.SgDeviceMapper">
 
    <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgDeviceDO">
        select ds.*,project.project_name as programName,dict."DICT_VALUE" as typeName from YWXT."SG_DEVICE" as ds left join YWXT."SG_PROJECT_INFO"  as project  on ds.program_id=project.id
        left join YWXT."BLADE_DICT_BIZ" as dict  on ds.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE' where 1=1
        <if test="dto.projectName != null and dto.projectName != ''">
            and project.project_name  like CONCAT(CONCAT('%', #{dto.projectName}), '%')
        </if>
        <if test="dto.projectId != null and dto.projectId != ''">
            and project.id = #{dto.projectId}
        </if>
        <if test="dto.deviceName != null and dto.deviceName != ''">
            and ds.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%')
        </if>
        <if test="dto.deviceType != null and dto.deviceType != ''">
            and ds.device_type = #{dto.deviceType}
        </if>
    </select>
    <select id="getSgDeviceById" resultType="cn.gistack.sm.sg.DO.SgDeviceDO">
        select ds.*,project.project_name as programName,dict."DICT_VALUE" as typeName from YWXT."SG_DEVICE" as ds left join YWXT."SG_PROJECT_INFO"  as project  on ds.program_id=project.id
        left join YWXT."BLADE_DICT_BIZ" as dict  on ds.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE' where  ds.id = #{id}
 
    </select>
</mapper>