123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- <?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.huaxu.zoniot.dao.MeterReadRecordMapper">
- <resultMap id="BaseResultMap" type="com.huaxu.zoniot.entity.MeterReadRecord">
- <!--@mbg.generated-->
- <!--@Table sc_meter_read_record-->
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="read_date" jdbcType="INTEGER" property="readDate" />
- <result column="site_id" jdbcType="INTEGER" property="siteId" />
- <result column="sys_id" jdbcType="INTEGER" property="sysId" />
- <result column="province" jdbcType="INTEGER" property="province" />
- <result column="city" jdbcType="INTEGER" property="city" />
- <result column="region" jdbcType="INTEGER" property="region" />
- <result column="community" jdbcType="INTEGER" property="community" />
- <result column="customer_id" jdbcType="INTEGER" property="customerId" />
- <result column="concentrator_id" jdbcType="INTEGER" property="concentratorId" />
- <result column="collector_id" jdbcType="INTEGER" property="collectorId" />
- <result column="building_id" jdbcType="INTEGER" property="buildingId" />
- <result column="location" jdbcType="VARCHAR" property="location" />
- <result column="device_type_id" jdbcType="INTEGER" property="deviceTypeId" />
- <result column="device_id" jdbcType="BIGINT" property="deviceId" />
- <result column="device_no" jdbcType="VARCHAR" property="deviceNo" />
- <result column="meter_no" jdbcType="VARCHAR" property="meterNo" />
- <result column="meter_file_no" jdbcType="VARCHAR" property="meterFileNo" />
- <result column="read_time" jdbcType="TIMESTAMP" property="readTime" />
- <result column="read_status" jdbcType="VARCHAR" property="readStatus" />
- <result column="read_data" jdbcType="VARCHAR" property="readData" />
- <result column="last_valid" jdbcType="VARCHAR" property="lastValid" />
- <result column="last_cost" jdbcType="DECIMAL" property="lastCost" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="date_create" jdbcType="TIMESTAMP" property="dateCreate" />
- <result column="date_update" jdbcType="TIMESTAMP" property="dateUpdate" />
- <result column="create_by" jdbcType="VARCHAR" property="createBy" />
- <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, read_date, site_id, sys_id, province, city, region, community, customer_id, concentrator_id,
- collector_id, building_id, `location`, device_type_id, device_id, device_no, meter_no,
- meter_file_no, read_time, read_status, read_data, last_valid, last_cost, `status`,
- date_create, date_update, create_by, update_by
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- <!--@mbg.generated-->
- select
- <include refid="Base_Column_List" />
- from sc_meter_read_record
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- delete from sc_meter_read_record
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.huaxu.zoniot.entity.MeterReadRecord">
- <!--@mbg.generated-->
- insert into sc_meter_read_record (id, read_date, site_id,
- sys_id, province, city,
- region, community, customer_id,
- concentrator_id, collector_id, building_id,
- `location`, device_type_id, device_id,
- device_no, meter_no, meter_file_no,
- read_time, read_status, read_data,
- last_valid, last_cost, `status`,
- date_create, date_update, create_by,
- update_by)
- values (#{id,jdbcType=BIGINT}, #{readDate,jdbcType=INTEGER}, #{siteId,jdbcType=INTEGER},
- #{sysId,jdbcType=INTEGER}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
- #{region,jdbcType=INTEGER}, #{community,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},
- #{concentratorId,jdbcType=INTEGER}, #{collectorId,jdbcType=INTEGER}, #{buildingId,jdbcType=INTEGER},
- #{location,jdbcType=VARCHAR}, #{deviceTypeId,jdbcType=INTEGER}, #{deviceId,jdbcType=BIGINT},
- #{deviceNo,jdbcType=VARCHAR}, #{meterNo,jdbcType=VARCHAR}, #{meterFileNo,jdbcType=VARCHAR},
- #{readTime,jdbcType=TIMESTAMP}, #{readStatus,jdbcType=VARCHAR}, #{readData,jdbcType=VARCHAR},
- #{lastValid,jdbcType=VARCHAR}, #{lastCost,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER},
- #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
- #{updateBy,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.huaxu.zoniot.entity.MeterReadRecord">
- <!--@mbg.generated-->
- insert into sc_meter_read_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="readDate != null">
- read_date,
- </if>
- <if test="siteId != null">
- site_id,
- </if>
- <if test="sysId != null">
- sys_id,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="city != null">
- city,
- </if>
- <if test="region != null">
- region,
- </if>
- <if test="community != null">
- community,
- </if>
- <if test="customerId != null">
- customer_id,
- </if>
- <if test="concentratorId != null">
- concentrator_id,
- </if>
- <if test="collectorId != null">
- collector_id,
- </if>
- <if test="buildingId != null">
- building_id,
- </if>
- <if test="location != null">
- `location`,
- </if>
- <if test="deviceTypeId != null">
- device_type_id,
- </if>
- <if test="deviceId != null">
- device_id,
- </if>
- <if test="deviceNo != null">
- device_no,
- </if>
- <if test="meterNo != null">
- meter_no,
- </if>
- <if test="meterFileNo != null">
- meter_file_no,
- </if>
- <if test="readTime != null">
- read_time,
- </if>
- <if test="readStatus != null">
- read_status,
- </if>
- <if test="readData != null">
- read_data,
- </if>
- <if test="lastValid != null">
- last_valid,
- </if>
- <if test="lastCost != null">
- last_cost,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="dateCreate != null">
- date_create,
- </if>
- <if test="dateUpdate != null">
- date_update,
- </if>
- <if test="createBy != null">
- create_by,
- </if>
- <if test="updateBy != null">
- update_by,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="readDate != null">
- #{readDate,jdbcType=INTEGER},
- </if>
- <if test="siteId != null">
- #{siteId,jdbcType=INTEGER},
- </if>
- <if test="sysId != null">
- #{sysId,jdbcType=INTEGER},
- </if>
- <if test="province != null">
- #{province,jdbcType=INTEGER},
- </if>
- <if test="city != null">
- #{city,jdbcType=INTEGER},
- </if>
- <if test="region != null">
- #{region,jdbcType=INTEGER},
- </if>
- <if test="community != null">
- #{community,jdbcType=INTEGER},
- </if>
- <if test="customerId != null">
- #{customerId,jdbcType=INTEGER},
- </if>
- <if test="concentratorId != null">
- #{concentratorId,jdbcType=INTEGER},
- </if>
- <if test="collectorId != null">
- #{collectorId,jdbcType=INTEGER},
- </if>
- <if test="buildingId != null">
- #{buildingId,jdbcType=INTEGER},
- </if>
- <if test="location != null">
- #{location,jdbcType=VARCHAR},
- </if>
- <if test="deviceTypeId != null">
- #{deviceTypeId,jdbcType=INTEGER},
- </if>
- <if test="deviceId != null">
- #{deviceId,jdbcType=BIGINT},
- </if>
- <if test="deviceNo != null">
- #{deviceNo,jdbcType=VARCHAR},
- </if>
- <if test="meterNo != null">
- #{meterNo,jdbcType=VARCHAR},
- </if>
- <if test="meterFileNo != null">
- #{meterFileNo,jdbcType=VARCHAR},
- </if>
- <if test="readTime != null">
- #{readTime,jdbcType=TIMESTAMP},
- </if>
- <if test="readStatus != null">
- #{readStatus,jdbcType=VARCHAR},
- </if>
- <if test="readData != null">
- #{readData,jdbcType=VARCHAR},
- </if>
- <if test="lastValid != null">
- #{lastValid,jdbcType=VARCHAR},
- </if>
- <if test="lastCost != null">
- #{lastCost,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="dateCreate != null">
- #{dateCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="dateUpdate != null">
- #{dateUpdate,jdbcType=TIMESTAMP},
- </if>
- <if test="createBy != null">
- #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="updateBy != null">
- #{updateBy,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.huaxu.zoniot.entity.MeterReadRecord">
- <!--@mbg.generated-->
- update sc_meter_read_record
- <set>
- <if test="readDate != null">
- read_date = #{readDate,jdbcType=INTEGER},
- </if>
- <if test="siteId != null">
- site_id = #{siteId,jdbcType=INTEGER},
- </if>
- <if test="sysId != null">
- sys_id = #{sysId,jdbcType=INTEGER},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=INTEGER},
- </if>
- <if test="city != null">
- city = #{city,jdbcType=INTEGER},
- </if>
- <if test="region != null">
- region = #{region,jdbcType=INTEGER},
- </if>
- <if test="community != null">
- community = #{community,jdbcType=INTEGER},
- </if>
- <if test="customerId != null">
- customer_id = #{customerId,jdbcType=INTEGER},
- </if>
- <if test="concentratorId != null">
- concentrator_id = #{concentratorId,jdbcType=INTEGER},
- </if>
- <if test="collectorId != null">
- collector_id = #{collectorId,jdbcType=INTEGER},
- </if>
- <if test="buildingId != null">
- building_id = #{buildingId,jdbcType=INTEGER},
- </if>
- <if test="location != null">
- `location` = #{location,jdbcType=VARCHAR},
- </if>
- <if test="deviceTypeId != null">
- device_type_id = #{deviceTypeId,jdbcType=INTEGER},
- </if>
- <if test="deviceId != null">
- device_id = #{deviceId,jdbcType=BIGINT},
- </if>
- <if test="deviceNo != null">
- device_no = #{deviceNo,jdbcType=VARCHAR},
- </if>
- <if test="meterNo != null">
- meter_no = #{meterNo,jdbcType=VARCHAR},
- </if>
- <if test="meterFileNo != null">
- meter_file_no = #{meterFileNo,jdbcType=VARCHAR},
- </if>
- <if test="readTime != null">
- read_time = #{readTime,jdbcType=TIMESTAMP},
- </if>
- <if test="readStatus != null">
- read_status = #{readStatus,jdbcType=VARCHAR},
- </if>
- <if test="readData != null">
- read_data = #{readData,jdbcType=VARCHAR},
- </if>
- <if test="lastValid != null">
- last_valid = #{lastValid,jdbcType=VARCHAR},
- </if>
- <if test="lastCost != null">
- last_cost = #{lastCost,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="dateCreate != null">
- date_create = #{dateCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="dateUpdate != null">
- date_update = #{dateUpdate,jdbcType=TIMESTAMP},
- </if>
- <if test="createBy != null">
- create_by = #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="updateBy != null">
- update_by = #{updateBy,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.huaxu.zoniot.entity.MeterReadRecord">
- <!--@mbg.generated-->
- update sc_meter_read_record
- set read_date = #{readDate,jdbcType=INTEGER},
- site_id = #{siteId,jdbcType=INTEGER},
- sys_id = #{sysId,jdbcType=INTEGER},
- province = #{province,jdbcType=INTEGER},
- city = #{city,jdbcType=INTEGER},
- region = #{region,jdbcType=INTEGER},
- community = #{community,jdbcType=INTEGER},
- customer_id = #{customerId,jdbcType=INTEGER},
- concentrator_id = #{concentratorId,jdbcType=INTEGER},
- collector_id = #{collectorId,jdbcType=INTEGER},
- building_id = #{buildingId,jdbcType=INTEGER},
- `location` = #{location,jdbcType=VARCHAR},
- device_type_id = #{deviceTypeId,jdbcType=INTEGER},
- device_id = #{deviceId,jdbcType=BIGINT},
- device_no = #{deviceNo,jdbcType=VARCHAR},
- meter_no = #{meterNo,jdbcType=VARCHAR},
- meter_file_no = #{meterFileNo,jdbcType=VARCHAR},
- read_time = #{readTime,jdbcType=TIMESTAMP},
- read_status = #{readStatus,jdbcType=VARCHAR},
- read_data = #{readData,jdbcType=VARCHAR},
- last_valid = #{lastValid,jdbcType=VARCHAR},
- last_cost = #{lastCost,jdbcType=DECIMAL},
- `status` = #{status,jdbcType=INTEGER},
- date_create = #{dateCreate,jdbcType=TIMESTAMP},
- date_update = #{dateUpdate,jdbcType=TIMESTAMP},
- create_by = #{createBy,jdbcType=VARCHAR},
- update_by = #{updateBy,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <insert id="batchInsert" parameterType="map">
- <!--@mbg.generated-->
- replace into sc_meter_read_record
- (id, read_date, site_id, sys_id, province, city, region, community, customer_id,
- concentrator_id, collector_id, building_id, `location`, device_type_id, device_id,
- device_no, meter_no, meter_file_no, read_time, read_status, read_data, last_valid,
- last_cost, `status`, date_create, date_update, create_by, update_by)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.id,jdbcType=BIGINT}, #{item.readDate,jdbcType=INTEGER}, #{item.siteId,jdbcType=INTEGER},
- #{item.sysId,jdbcType=INTEGER}, #{item.province,jdbcType=INTEGER}, #{item.city,jdbcType=INTEGER},
- #{item.region,jdbcType=INTEGER}, #{item.community,jdbcType=INTEGER}, #{item.customerId,jdbcType=INTEGER},
- #{item.concentratorId,jdbcType=INTEGER}, #{item.collectorId,jdbcType=INTEGER},
- #{item.buildingId,jdbcType=INTEGER}, #{item.location,jdbcType=VARCHAR}, #{item.deviceTypeId,jdbcType=INTEGER},
- #{item.deviceId,jdbcType=BIGINT}, #{item.deviceNo,jdbcType=VARCHAR}, #{item.meterNo,jdbcType=VARCHAR},
- #{item.meterFileNo,jdbcType=VARCHAR}, #{item.readTime,jdbcType=TIMESTAMP}, #{item.readStatus,jdbcType=VARCHAR},
- #{item.readData,jdbcType=VARCHAR}, #{item.lastValid,jdbcType=VARCHAR}, #{item.lastCost,jdbcType=DECIMAL},
- #{item.status,jdbcType=INTEGER}, #{item.dateCreate,jdbcType=TIMESTAMP}, #{item.dateUpdate,jdbcType=TIMESTAMP},
- #{item.createBy,jdbcType=VARCHAR}, #{item.updateBy,jdbcType=VARCHAR})
- </foreach>
- </insert>
- <select id="findRecordByReadDayAndDeviceId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from
- sc_meter_read_record
- where
- status = 1
- and read_date = #{readDate,jdbcType=INTEGER}
- and device_id = #{deviceId,jdbcType=BIGINT}
- </select>
- <update id="deleteRecordByReadDayAndDeviceId">
- update sc_meter_read_record set status = 0
- where
- read_date = #{readDate,jdbcType=INTEGER}
- and device_id = #{deviceId,jdbcType=BIGINT}
- </update>
- </mapper>
|