|
|
|
@@ -0,0 +1,71 @@ |
|
|
|
<?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.KwMetersMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.KwMeters"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="address" jdbcType="BIGINT" property="address"/> |
|
|
|
<result column="brand" jdbcType="VARCHAR" property="brand"/> |
|
|
|
<result column="place" jdbcType="VARCHAR" property="place"/> |
|
|
|
<result column="model" jdbcType="VARCHAR" property="model"/> |
|
|
|
<result column="protocol" jdbcType="INTEGER" property="protocol"/> |
|
|
|
<result column="bandrate" jdbcType="INTEGER" property="bandrate"/> |
|
|
|
<result column="online" jdbcType="INTEGER" property="online"/> |
|
|
|
<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`,`address`,`brand`,`model`,`place`,`protocol`,`bandrate`,`online`,`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 != address and '' != address "> |
|
|
|
and `address` like concat('%', #{address},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != brand and '' != brand "> |
|
|
|
and `brand` like concat('%', #{brand},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != place and '' != place "> |
|
|
|
and `place` like concat('%', #{place},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != model "> |
|
|
|
and `model` = #{model} |
|
|
|
</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.KwMeters" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from kw_meters |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |