|
|
|
@@ -0,0 +1,74 @@ |
|
|
|
<?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.iformall.mapper.KwBoxMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwBox"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="name"/> |
|
|
|
<result column="imei" jdbcType="BIGINT" property="imei"/> |
|
|
|
<result column="iccid" jdbcType="VARCHAR" property="iccid"/> |
|
|
|
<result column="place" jdbcType="VARCHAR" property="place"/> |
|
|
|
<result column="fw_version" jdbcType="VARCHAR" property="fwVersion"/> |
|
|
|
<result column="hd_version" jdbcType="VARCHAR" property="hdVersion"/> |
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/> |
|
|
|
<result column="online" jdbcType="INTEGER" property="online"/> |
|
|
|
<result column="register_time" jdbcType="TIMESTAMP" property="registerTime"/> |
|
|
|
<result column="last_online_time" jdbcType="TIMESTAMP" property="lastOnlineTime"/> |
|
|
|
<result column="config" jdbcType="VARCHAR" property="config"/> |
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> |
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`imei`,`iccid`,`place`,`fw_version`,`hd_version`,`status`,`online`,`register_time`, |
|
|
|
`last_online_time`,`config`,`create_time`,`update_time` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != imei and '' != imei "> |
|
|
|
and `imei` like concat('%', #{imei},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != iccid and '' != iccid "> |
|
|
|
and `iccid` like concat('%', #{iccid},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != place and '' != place "> |
|
|
|
and `place` like concat('%', #{place},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != status "> |
|
|
|
and `status` = #{status} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `online` = #{online} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.KwBox" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from kw_box |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |