|
@@ -0,0 +1,205 @@
|
|
|
+<?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.zcxk.rmcp.core.dao.MeasurementSettlementMapper">
|
|
|
+ <!-- 结果集 -->
|
|
|
+ <resultMap type="com.zcxk.rmcp.core.entity.MeasurementSettlement" id="MeasurementSettlementMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="settlementTime" column="settlement_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="companyOrgId" column="company_org_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="deptOrgId" column="dept_org_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="communityId" column="community_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="totalWaterMeters" column="total_water_meters" jdbcType="INTEGER"/>
|
|
|
+ <result property="numberOfWaterMetersReviewed" column="number_of_water_meters_reviewed" jdbcType="INTEGER"/>
|
|
|
+ <result property="billingPeriod" column="billing_period" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="billingCycle" column="billing_cycle" jdbcType="INTEGER"/>
|
|
|
+ <result property="planStatus" column="plan_status" jdbcType="INTEGER"/>
|
|
|
+ <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="status" jdbcType="VARCHAR"/>
|
|
|
+ <result property="taskId" column="task_id" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 基本字段 -->
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, plan_name, settlement_time, company_org_id, dept_org_id, community_id, total_water_meters, number_of_water_meters_reviewed, billing_period, billing_cycle, plan_status, create_date, update_date, create_by, update_by, status, task_id </sql>
|
|
|
+
|
|
|
+ <!-- 查询单个 -->
|
|
|
+ <select id="selectById" resultMap="MeasurementSettlementMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from rmcp_measurement_settlement
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询全部 -->
|
|
|
+ <select id="selectAll" resultMap="MeasurementSettlementMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from rmcp_measurement_settlement
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过实体作为筛选条件查询-->
|
|
|
+ <select id="selectList" resultType="com.zcxk.rmcp.api.dto.measurementSettlement.MeasurementSettlementDto">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from rmcp_measurement_settlement
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="planName != null and planName != ''">
|
|
|
+ and plan_name = #{planName}
|
|
|
+ </if>
|
|
|
+ <if test="settlementTime != null">
|
|
|
+ and settlement_time = #{settlementTime}
|
|
|
+ </if>
|
|
|
+ <if test="companyOrgId != null">
|
|
|
+ and company_org_id = #{companyOrgId}
|
|
|
+ </if>
|
|
|
+ <if test="deptOrgId != null">
|
|
|
+ and dept_org_id = #{deptOrgId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null">
|
|
|
+ and community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ <if test="totalWaterMeters != null">
|
|
|
+ and total_water_meters = #{totalWaterMeters}
|
|
|
+ </if>
|
|
|
+ <if test="numberOfWaterMetersReviewed != null">
|
|
|
+ and number_of_water_meters_reviewed = #{numberOfWaterMetersReviewed}
|
|
|
+ </if>
|
|
|
+ <if test="billingPeriod != null">
|
|
|
+ and billing_period = #{billingPeriod}
|
|
|
+ </if>
|
|
|
+ <if test="billingCycle != null">
|
|
|
+ and billing_cycle = #{billingCycle}
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ and plan_status = #{planStatus}
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ and create_date = #{createDate}
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ and update_date = #{updateDate}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ and create_by = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ and update_by = #{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="taskId != null">
|
|
|
+ and task_id = #{taskId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 新增所有列 -->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into rmcp_measurement_settlement(id, plan_name, settlement_time, company_org_id, dept_org_id,
|
|
|
+ community_id, total_water_meters, number_of_water_meters_reviewed,
|
|
|
+ billing_period, billing_cycle, plan_status, create_date, update_date,
|
|
|
+ create_by, update_by, status, task_id)
|
|
|
+ values (#{id}, #{planName}, #{settlementTime}, #{companyOrgId}, #{deptOrgId}, #{communityId},
|
|
|
+ #{totalWaterMeters}, #{numberOfWaterMetersReviewed}, #{billingPeriod}, #{billingCycle}, #{planStatus},
|
|
|
+ #{createDate}, #{updateDate}, #{createBy}, #{updateBy}, #{status}, #{taskId})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 批量新增 -->
|
|
|
+ <insert id="batchInsert">
|
|
|
+ insert into rmcp_measurement_settlement(id, plan_name, settlement_time, company_org_id, dept_org_id,
|
|
|
+ community_id, total_water_meters, number_of_water_meters_reviewed, billing_period, billing_cycle, plan_status,
|
|
|
+ create_date, update_date, create_by, update_by, status, task_id)
|
|
|
+ values
|
|
|
+ <foreach collection="measurementSettlements" item="item" index="index" separator=",">
|
|
|
+ (
|
|
|
+ #{item.id}, #{item.planName}, #{item.settlementTime}, #{item.companyOrgId}, #{item.deptOrgId},
|
|
|
+ #{item.communityId}, #{item.totalWaterMeters}, #{item.numberOfWaterMetersReviewed}, #{item.billingPeriod},
|
|
|
+ #{item.billingCycle}, #{item.planStatus}, #{item.createDate}, #{item.updateDate}, #{item.createBy},
|
|
|
+ #{item.updateBy}, #{item.status}, #{item.taskId} )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 通过主键修改数据 -->
|
|
|
+ <update id="update">
|
|
|
+ update rmcp_measurement_settlement
|
|
|
+ <set>
|
|
|
+ <if test="planName != null and planName != ''">
|
|
|
+ plan_name = #{planName},
|
|
|
+ </if>
|
|
|
+ <if test="settlementTime != null">
|
|
|
+ settlement_time = #{settlementTime},
|
|
|
+ </if>
|
|
|
+ <if test="companyOrgId != null">
|
|
|
+ company_org_id = #{companyOrgId},
|
|
|
+ </if>
|
|
|
+ <if test="deptOrgId != null">
|
|
|
+ dept_org_id = #{deptOrgId},
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null">
|
|
|
+ community_id = #{communityId},
|
|
|
+ </if>
|
|
|
+ <if test="totalWaterMeters != null">
|
|
|
+ total_water_meters = #{totalWaterMeters},
|
|
|
+ </if>
|
|
|
+ <if test="numberOfWaterMetersReviewed != null">
|
|
|
+ number_of_water_meters_reviewed = #{numberOfWaterMetersReviewed},
|
|
|
+ </if>
|
|
|
+ <if test="billingPeriod != null">
|
|
|
+ billing_period = #{billingPeriod},
|
|
|
+ </if>
|
|
|
+ <if test="billingCycle != null">
|
|
|
+ billing_cycle = #{billingCycle},
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ plan_status = #{planStatus},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ create_date = #{createDate},
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ update_date = #{updateDate},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ create_by = #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ update_by = #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="taskId != null">
|
|
|
+ task_id = #{taskId},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+ <update id="setBillingPeriod"></update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from rmcp_measurement_settlement
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+ <delete id="deletePlan"></delete>
|
|
|
+ <delete id="deleteAll"></delete>
|
|
|
+
|
|
|
+ <!-- 总数 -->
|
|
|
+ <select id="count" resultType="int">
|
|
|
+ select count(*)
|
|
|
+ from rmcp_measurement_settlement
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectRecordList"
|
|
|
+ resultType="com.zcxk.rmcp.api.dto.measurementSettlement.MeasurementSettlementDto"></select>
|
|
|
+</mapper>
|