<?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>
|