|
@@ -4,430 +4,56 @@
|
|
|
<resultMap id="BaseResultMap" type="com.zoniot.ccrc.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" />
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="read_date" property="readDate" />
|
|
|
+ <result column="site_id" property="siteId" />
|
|
|
+ <result column="sys_id" property="sysId" />
|
|
|
+ <result column="province" property="province" />
|
|
|
+ <result column="city" property="city" />
|
|
|
+ <result column="region" property="region" />
|
|
|
+ <result column="community" property="community" />
|
|
|
+ <result column="customer_id" property="customerId" />
|
|
|
+ <result column="concentrator_id" property="concentratorId" />
|
|
|
+ <result column="collector_id" property="collectorId" />
|
|
|
+ <result column="building_id" property="buildingId" />
|
|
|
+ <result column="location" property="location" />
|
|
|
+ <result column="device_type_id" property="deviceTypeId" />
|
|
|
+ <result column="device_id" property="deviceId" />
|
|
|
+ <result column="device_no" property="deviceNo" />
|
|
|
+ <result column="meter_no" property="meterNo" />
|
|
|
+ <result column="meter_file_no" property="meterFileNo" />
|
|
|
+ <result column="read_time" property="readTime" />
|
|
|
+ <result column="read_status" property="readStatus" />
|
|
|
+ <result column="read_data" property="readData" />
|
|
|
+ <result column="last_valid" property="lastValid" />
|
|
|
+ <result column="last_cost" property="lastCost" />
|
|
|
+ <result column="status" property="status" />
|
|
|
+ <result column="date_create" property="dateCreate" />
|
|
|
+ <result column="date_update" property="dateUpdate" />
|
|
|
+ <result column="create_by" property="createBy" />
|
|
|
+ <result column="update_by" property="updateBy" />
|
|
|
+ <result column="valve_status" property="valveStatus" />
|
|
|
+ <result column="meter_status_info" property="meterStatusInfo" />
|
|
|
</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
|
|
|
+ date_create, date_update, create_by, update_by, valve_status, meter_status_info
|
|
|
</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.zoniot.ccrc.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.zoniot.ccrc.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.zoniot.ccrc.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.zoniot.ccrc.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,valve_status,meter_status_info)
|
|
|
- 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},
|
|
|
- #{item.valveState,jdbcType=INTEGER}, #{item.meterStatusInfo,jdbcType=VARCHAR})
|
|
|
- </foreach>
|
|
|
- </insert>
|
|
|
- <select id="findRecordByReadDayAndDeviceId" resultMap="BaseResultMap">
|
|
|
+
|
|
|
+ <select id="getList" 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>
|
|
|
- <select id="getDeviceVolume" resultType="java.lang.Double">
|
|
|
- select ifnull(sum(last_cost),0) from sc_meter_read_record
|
|
|
- where status = 1 and device_id = #{deviceId} and
|
|
|
- read_date <![CDATA[ >= ]]> #{startDate} and read_date <![CDATA[ <= ]]> #{endDate}
|
|
|
- </select>
|
|
|
- <select id="getRealTimeUseWater" resultType="com.zoniot.ccrc.dto.UseWaterDto">
|
|
|
- select read_date as date,last_cost as use_volume from sc_meter_read_record
|
|
|
- where status = 1 and device_id = #{deviceId} and
|
|
|
- read_date <![CDATA[ >= ]]> #{startDate} and read_date <![CDATA[ <= ]]> #{endDate}
|
|
|
- order by read_data asc
|
|
|
- </select>
|
|
|
- <select id="getUseWaterByMonth" resultType="com.zoniot.ccrc.dto.UseWaterDto">
|
|
|
- SELECT DATE_FORMAT(read_date,'%Y%m') as date,sum(last_cost) as useVolume FROM sc_meter_read_record
|
|
|
- where status = 1 and device_id = #{deviceId}
|
|
|
- and read_date <![CDATA[ >= ]]> #{startDate} and read_date <![CDATA[ <= ]]> #{endDate}
|
|
|
- GROUP BY date
|
|
|
- </select>
|
|
|
- <select id="getYesterReadData" resultType="com.zoniot.ccrc.repository.MongoMeterReadRecord">
|
|
|
- select last_cost from sc_meter_read_record where status = 1 and device_id = #{deviceId}
|
|
|
- and read_date=#{date}
|
|
|
+ id,
|
|
|
+ device_id,
|
|
|
+ read_data,
|
|
|
+ valve_status,
|
|
|
+ meter_status_info,
|
|
|
+ read_time
|
|
|
+ from sc_meter_read_record where status = 1 and device_id = #{deviceId} and read_status = '2'
|
|
|
+ <if test="startDate != null and startDate != 0"> and read_date <![CDATA[ >= ]]> #{startDate} </if>
|
|
|
+ <if test="endDate != null and endDate != 0"> and read_date <![CDATA[ <= ]]> #{endDate} </if>
|
|
|
+ order by date_create desc
|
|
|
</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>
|