Просмотр исходного кода

[智能电表][修改][电表表mapper.xml]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
07f2d5bcdc
2 измененных файлов: 72 добавлений и 1 удалений
  1. +1
    -1
      mallinkService/src/main/resources/mapper/KwBoxMapper.xml
  2. +71
    -0
      mallinkService/src/main/resources/mapper/KwMetersMapper.xml

+ 1
- 1
mallinkService/src/main/resources/mapper/KwBoxMapper.xml Просмотреть файл

@@ -3,7 +3,7 @@
<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="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="imei" jdbcType="BIGINT" property="imei"/>
<result column="iccid" jdbcType="VARCHAR" property="iccid"/>
<result column="place" jdbcType="VARCHAR" property="place"/>


+ 71
- 0
mallinkService/src/main/resources/mapper/KwMetersMapper.xml Просмотреть файл

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

Загрузка…
Отмена
Сохранить