xuhy
6 天以前 11ecb9ee39fc61af04cd8d462faf9dce496d1773
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
<?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.ruoyi.system.mapper.TCrmDeviceMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TCrmDevice">
        <id column="id" property="id" />
        <result column="clinic_id" property="clinicId" />
        <result column="device_code" property="deviceCode" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, clinic_id, device_code, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TCrmDeviceVO">
        select tcd.id, tcd.clinic_id, tcd.device_code, tcd.create_time, tcd.update_time,
               tcd.create_by, tcd.update_by, tcd.disabled, tcc.clinic_name
        from t_crm_device tcd
        left join t_crm_clinic tcc on tcd.clinic_id = tcc.id
        <where>
            <if test="query.clinicId != null and query.clinicId != ''">
                and tcd.clinic_id = #{query.clinicId}
            </if>
            <if test="query.deviceCode != null and query.deviceCode != ''">
                and tcd.device_code LIKE concat('%',#{query.deviceCode},'%')
            </if>
            AND tcd.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tcd.create_time DESC
    </select>
 
</mapper>