shiyunteng
2025-03-25 62f0eb6e3296fa3ef589e48bca06198ed26f9893
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
<?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.by4cloud.platformx.device.mapper.DeviceTechnicalAgreementMapper">
 
  <resultMap id="deviceTechnicalAgreementMap" type="com.by4cloud.platformx.device.entity.DeviceTechnicalAgreemnt">
        <id property="id" column="id"/>
        <result property="compId" column="comp_id"/>
        <result property="arrivalMonth" column="arrival_month"/>
        <result property="contractId" column="contract_id"/>
        <result property="deviceCode" column="device_code"/>
        <result property="deviceId" column="device_id"/>
        <result property="deviceModels" column="device_models"/>
        <result property="deviceName" column="device_name"/>
        <result property="keyParameter" column="key_parameter"/>
        <result property="partya" column="partya"/>
        <result property="partyb" column="partyb"/>
        <result property="partyc" column="partyc"/>
        <result property="quantity" column="quantity"/>
        <result property="signDate" column="sign_date"/>
        <result property="termContent" column="term_content"/>
        <result property="unit" column="unit"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
    <select id="page" resultType="com.by4cloud.platformx.device.entity.vo.DeviceTechnicalAgreementPageVo">
        select
            dta.id,
            c.name contractName,
            dta.partya ,
            dta.partyb ,
            dta.partyc ,
            dta.sign_date ,
            d.name deviceName,
            d.`number` deviceCode
        from
            device_technical_agreement dta
        join contract c on dta.contract_id = c.id
        join device d on d.id = dta.device_id
        where
            dta.del_flag = '0'
        <if test="queryDTO.contractName != null and queryDTO.contractName !=''">
            and c.name like CONCAT('%', #{queryDTO.contractName}, '%')
        </if>
        <if test="queryDTO.deviceName != null and queryDTO.deviceName !=''">
            and d.name like CONCAT('%', #{queryDTO.deviceName}, '%')
        </if>
    </select>
 
</mapper>