liujie
2025-05-09 fdec3aa2487acee81ebc80aba88852f0f5036ef4
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
<?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.stylefeng.guns.modular.system.dao.TDeviceMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TDevice">
        <id column="id" property="id" />
        <result column="serNum" property="serNum" />
        <result column="bindId" property="bindId" />
        <result column="bindTime" property="bindTime" />
        <result column="status" property="status" />
        <result column="mac" property="mac" />
        <result column="version" property="version" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, serNum, bindId, bindTime, status, mac, version
    </sql>
    <select id="searchList" resultType="map">
        select td.*,tu.name,tu.phone
        from t_device td
        left join sys_user tu on td.bindId = tu.id
        <where>
            <if test="serNum != null and serNum != ''">
                and td.serNum = #{serNum}
            </if>
            <if test="phone != null and phone != ''">
                and tu.phone = #{phone}
            </if>
            <if test="name != null and name != ''">
                and tu.name = #{name}
            </if>
            <if test="status != null  ">
                and td.status = #{status}
            </if>
        </where>
 
 
    </select>
 
</mapper>