| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <?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.ruoyi.api.mapper.WwkjWaterMeterMapper">
-
- <resultMap type="WwkjWaterMeter" id="WwkjWaterMeterResult">
- <result property="id" column="id" />
- <result property="MeterCode" column="MeterCode" />
- <result property="LifetimeCode" column="LifetimeCode" />
- <result property="LeadSeal" column="LeadSeal" />
- <result property="CustomerCode" column="CustomerCode" />
- <result property="MeterType" column="MeterType" />
- <result property="BasicType" column="BasicType" />
- <result property="InputType" column="InputType" />
- <result property="ReadType" column="ReadType" />
- <result property="Type" column="Type" />
- <result property="MeterPlaceCode" column="MeterPlaceCode" />
- <result property="ModelCode" column="ModelCode" />
- <result property="MeterCliber" column="MeterCliber" />
- <result property="RatioQ" column="RatioQ" />
- <result property="MeterRatio" column="MeterRatio" />
- <result property="StartReading" column="StartReading" />
- <result property="EndReading" column="EndReading" />
- <result property="NeterRange" column="NeterRange" />
- <result property="ChangeMeterCycle" column="ChangeMeterCycle" />
- <result property="CreateCustomeDate" column="CreateCustomeDate" />
- <result property="InstallDate" column="InstallDate" />
- <result property="RemoveDate" column="RemoveDate" />
- <result property="RunStatus" column="RunStatus" />
- <result property="ValueStatus" column="ValueStatus" />
- <result property="ICCID" column="ICCID" />
- <result property="IMEI" column="IMEI" />
- <result property="DmaName" column="DmaName" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectWwkjWaterMeterVo">
- select id, MeterCode, LifetimeCode, LeadSeal, CustomerCode, MeterType, BasicType, InputType, ReadType, Type, MeterPlaceCode, ModelCode, MeterCliber, RatioQ, MeterRatio, StartReading, EndReading, NeterRange, ChangeMeterCycle, CreateCustomeDate, InstallDate, RemoveDate, RunStatus, ValueStatus, ICCID, IMEI, DmaName, del_flag, create_by, create_time, update_by, update_time from wwkj_water_meter
- </sql>
- <select id="selectWwkjWaterMeterList" parameterType="WwkjWaterMeter" resultMap="WwkjWaterMeterResult">
- <include refid="selectWwkjWaterMeterVo"/>
- <where>
- <if test="MeterCode != null and MeterCode != ''"> and MeterCode = #{MeterCode}</if>
- <if test="LifetimeCode != null and LifetimeCode != ''"> and LifetimeCode = #{LifetimeCode}</if>
- <if test="LeadSeal != null and LeadSeal != ''"> and LeadSeal = #{LeadSeal}</if>
- <if test="CustomerCode != null and CustomerCode != ''"> and CustomerCode = #{CustomerCode}</if>
- <if test="MeterType != null "> and MeterType = #{MeterType}</if>
- <if test="BasicType != null "> and BasicType = #{BasicType}</if>
- <if test="InputType != null "> and InputType = #{InputType}</if>
- <if test="ReadType != null "> and ReadType = #{ReadType}</if>
- <if test="Type != null "> and Type = #{Type}</if>
- <if test="MeterPlaceCode != null "> and MeterPlaceCode = #{MeterPlaceCode}</if>
- <if test="ModelCode != null and ModelCode != ''"> and ModelCode = #{ModelCode}</if>
- <if test="MeterCliber != null and MeterCliber != ''"> and MeterCliber = #{MeterCliber}</if>
- <if test="RatioQ != null "> and RatioQ = #{RatioQ}</if>
- <if test="MeterRatio != null "> and MeterRatio = #{MeterRatio}</if>
- <if test="StartReading != null "> and StartReading = #{StartReading}</if>
- <if test="EndReading != null "> and EndReading = #{EndReading}</if>
- <if test="NeterRange != null "> and NeterRange = #{NeterRange}</if>
- <if test="ChangeMeterCycle != null "> and ChangeMeterCycle = #{ChangeMeterCycle}</if>
- <if test="CreateCustomeDate != null "> and CreateCustomeDate = #{CreateCustomeDate}</if>
- <if test="InstallDate != null "> and InstallDate = #{InstallDate}</if>
- <if test="RemoveDate != null "> and RemoveDate = #{RemoveDate}</if>
- <if test="RunStatus != null "> and RunStatus = #{RunStatus}</if>
- <if test="ValueStatus != null and ValueStatus != ''"> and ValueStatus = #{ValueStatus}</if>
- <if test="ICCID != null and ICCID != ''"> and ICCID = #{ICCID}</if>
- <if test="IMEI != null and IMEI != ''"> and IMEI = #{IMEI}</if>
- <if test="DmaName != null and DmaName != ''"> and DmaName like concat('%', #{DmaName}, '%')</if>
- </where>
- </select>
-
- <select id="selectWwkjWaterMeterById" parameterType="Long" resultMap="WwkjWaterMeterResult">
- <include refid="selectWwkjWaterMeterVo"/>
- where id = #{id}
- </select>
- <insert id="insertWwkjWaterMeter" parameterType="WwkjWaterMeter" useGeneratedKeys="true" keyProperty="id">
- insert into wwkj_water_meter
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="MeterCode != null and MeterCode != ''">MeterCode,</if>
- <if test="LifetimeCode != null">LifetimeCode,</if>
- <if test="LeadSeal != null">LeadSeal,</if>
- <if test="CustomerCode != null">CustomerCode,</if>
- <if test="MeterType != null">MeterType,</if>
- <if test="BasicType != null">BasicType,</if>
- <if test="InputType != null">InputType,</if>
- <if test="ReadType != null">ReadType,</if>
- <if test="Type != null">Type,</if>
- <if test="MeterPlaceCode != null">MeterPlaceCode,</if>
- <if test="ModelCode != null">ModelCode,</if>
- <if test="MeterCliber != null">MeterCliber,</if>
- <if test="RatioQ != null">RatioQ,</if>
- <if test="MeterRatio != null">MeterRatio,</if>
- <if test="StartReading != null">StartReading,</if>
- <if test="EndReading != null">EndReading,</if>
- <if test="NeterRange != null">NeterRange,</if>
- <if test="ChangeMeterCycle != null">ChangeMeterCycle,</if>
- <if test="CreateCustomeDate != null">CreateCustomeDate,</if>
- <if test="InstallDate != null">InstallDate,</if>
- <if test="RemoveDate != null">RemoveDate,</if>
- <if test="RunStatus != null">RunStatus,</if>
- <if test="ValueStatus != null">ValueStatus,</if>
- <if test="ICCID != null">ICCID,</if>
- <if test="IMEI != null">IMEI,</if>
- <if test="DmaName != null">DmaName,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="MeterCode != null and MeterCode != ''">#{MeterCode},</if>
- <if test="LifetimeCode != null">#{LifetimeCode},</if>
- <if test="LeadSeal != null">#{LeadSeal},</if>
- <if test="CustomerCode != null">#{CustomerCode},</if>
- <if test="MeterType != null">#{MeterType},</if>
- <if test="BasicType != null">#{BasicType},</if>
- <if test="InputType != null">#{InputType},</if>
- <if test="ReadType != null">#{ReadType},</if>
- <if test="Type != null">#{Type},</if>
- <if test="MeterPlaceCode != null">#{MeterPlaceCode},</if>
- <if test="ModelCode != null">#{ModelCode},</if>
- <if test="MeterCliber != null">#{MeterCliber},</if>
- <if test="RatioQ != null">#{RatioQ},</if>
- <if test="MeterRatio != null">#{MeterRatio},</if>
- <if test="StartReading != null">#{StartReading},</if>
- <if test="EndReading != null">#{EndReading},</if>
- <if test="NeterRange != null">#{NeterRange},</if>
- <if test="ChangeMeterCycle != null">#{ChangeMeterCycle},</if>
- <if test="CreateCustomeDate != null">#{CreateCustomeDate},</if>
- <if test="InstallDate != null">#{InstallDate},</if>
- <if test="RemoveDate != null">#{RemoveDate},</if>
- <if test="RunStatus != null">#{RunStatus},</if>
- <if test="ValueStatus != null">#{ValueStatus},</if>
- <if test="ICCID != null">#{ICCID},</if>
- <if test="IMEI != null">#{IMEI},</if>
- <if test="DmaName != null">#{DmaName},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateWwkjWaterMeter" parameterType="WwkjWaterMeter">
- update wwkj_water_meter
- <trim prefix="SET" suffixOverrides=",">
- <if test="MeterCode != null and MeterCode != ''">MeterCode = #{MeterCode},</if>
- <if test="LifetimeCode != null">LifetimeCode = #{LifetimeCode},</if>
- <if test="LeadSeal != null">LeadSeal = #{LeadSeal},</if>
- <if test="CustomerCode != null">CustomerCode = #{CustomerCode},</if>
- <if test="MeterType != null">MeterType = #{MeterType},</if>
- <if test="BasicType != null">BasicType = #{BasicType},</if>
- <if test="InputType != null">InputType = #{InputType},</if>
- <if test="ReadType != null">ReadType = #{ReadType},</if>
- <if test="Type != null">Type = #{Type},</if>
- <if test="MeterPlaceCode != null">MeterPlaceCode = #{MeterPlaceCode},</if>
- <if test="ModelCode != null">ModelCode = #{ModelCode},</if>
- <if test="MeterCliber != null">MeterCliber = #{MeterCliber},</if>
- <if test="RatioQ != null">RatioQ = #{RatioQ},</if>
- <if test="MeterRatio != null">MeterRatio = #{MeterRatio},</if>
- <if test="StartReading != null">StartReading = #{StartReading},</if>
- <if test="EndReading != null">EndReading = #{EndReading},</if>
- <if test="NeterRange != null">NeterRange = #{NeterRange},</if>
- <if test="ChangeMeterCycle != null">ChangeMeterCycle = #{ChangeMeterCycle},</if>
- <if test="CreateCustomeDate != null">CreateCustomeDate = #{CreateCustomeDate},</if>
- <if test="InstallDate != null">InstallDate = #{InstallDate},</if>
- <if test="RemoveDate != null">RemoveDate = #{RemoveDate},</if>
- <if test="RunStatus != null">RunStatus = #{RunStatus},</if>
- <if test="ValueStatus != null">ValueStatus = #{ValueStatus},</if>
- <if test="ICCID != null">ICCID = #{ICCID},</if>
- <if test="IMEI != null">IMEI = #{IMEI},</if>
- <if test="DmaName != null">DmaName = #{DmaName},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteWwkjWaterMeterById" parameterType="Long">
- delete from wwkj_water_meter where id = #{id}
- </delete>
- <delete id="deleteWwkjWaterMeterByIds" parameterType="String">
- delete from wwkj_water_meter where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectByMeterCode" parameterType="String" resultMap="WwkjWaterMeterResult">
- <include refid="selectWwkjWaterMeterVo"/>
- where MeterCode = #{meterCode} and del_flag = '0'
- </select>
- <select id="selectWaterMeterByCustomerCodes" resultMap="WwkjWaterMeterResult">
- select MeterCode, LifetimeCode, CustomerCode, MeterCliber, MeterPlaceCode, RunStatus, del_flag
- from wwkj_water_meter
- where del_flag = '0'
- and RunStatus = 0 -- 只查询运行状态为0(启用)的水表
- <if test="list != null and list.size() > 0">
- and CustomerCode in
- <foreach collection="list" item="code" open="(" separator="," close=")">
- #{code}
- </foreach>
- </if>
- <if test="list == null or list.size() == 0">
- and 1=0
- </if>
- order by InstallDate asc -- 按安装日期排序,最早安装的排前面
- </select>
- </mapper>
|