|
@@ -37,8 +37,8 @@
|
|
<if test="payControlRecordDto.type != null"> and pcr.type = #{payControlRecordDto.type}</if>
|
|
<if test="payControlRecordDto.type != null"> and pcr.type = #{payControlRecordDto.type}</if>
|
|
<if test="payControlRecordDto.result != null"> and pcr.result = #{payControlRecordDto.result}</if>
|
|
<if test="payControlRecordDto.result != null"> and pcr.result = #{payControlRecordDto.result}</if>
|
|
<if test="payControlRecordDto.state != null"> and pcr.state = #{payControlRecordDto.state}</if>
|
|
<if test="payControlRecordDto.state != null"> and pcr.state = #{payControlRecordDto.state}</if>
|
|
- <if test="payControlRecordDto.beginTime != null"> and pcr.update_Date >= #{payControlRecordDto.beginTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
- <if test="payControlRecordDto.endTime != null"> and pcr.update_Date <= #{payControlRecordDto.endTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
|
|
+ <if test="payControlRecordDto.beginTime != null"> and pcr.create_date >= #{payControlRecordDto.beginTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
+ <if test="payControlRecordDto.endTime != null"> and pcr.create_date <= #{payControlRecordDto.endTime,jdbcType=TIMESTAMP}</if>
|
|
<if test="payControlRecordDto.meterCode != null and payControlRecordDto.meterCode != ''">
|
|
<if test="payControlRecordDto.meterCode != null and payControlRecordDto.meterCode != ''">
|
|
and (sc.metercode like concat('%',#{payControlRecordDto.meterCode},'%')
|
|
and (sc.metercode like concat('%',#{payControlRecordDto.meterCode},'%')
|
|
or sc.water_meter_no like concat('%',#{payControlRecordDto.meterCode},'%')
|
|
or sc.water_meter_no like concat('%',#{payControlRecordDto.meterCode},'%')
|
|
@@ -47,6 +47,43 @@
|
|
</where>
|
|
</where>
|
|
order by pcr.update_date desc
|
|
order by pcr.update_date desc
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="findListByMeterCode" resultType="com.bz.smart_city.dto.pay.PayControlRecordDto">
|
|
|
|
+ select
|
|
|
|
+ pcr.id,
|
|
|
|
+ pcr.account_id,
|
|
|
|
+ pcr.meter_id,
|
|
|
|
+ pcr.type,
|
|
|
|
+ pcr.result,
|
|
|
|
+ pcr.state,
|
|
|
|
+ pcr.control_rule_id,
|
|
|
|
+ pcr.create_by,
|
|
|
|
+ pcr.create_date,
|
|
|
|
+ pcr.update_by,
|
|
|
|
+ pcr.update_date,
|
|
|
|
+ pcr.remarks,
|
|
|
|
+ pcr.site_id,
|
|
|
|
+ pcr.customer_id,
|
|
|
|
+ pcrule.name as controlRuleIdName,
|
|
|
|
+ sc.water_meter_no,
|
|
|
|
+ sc.metercode,
|
|
|
|
+ sc.device_model,
|
|
|
|
+ sc.loc_desc,
|
|
|
|
+ sc.control_status
|
|
|
|
+ from pay_control_record pcr
|
|
|
|
+ left join pay_control_rule pcrule on pcr.control_rule_id = pcrule.id
|
|
|
|
+ left join sc_device sc on pcr.meter_id = sc.id
|
|
|
|
+ <where>
|
|
|
|
+ pcr.del_flag = 0
|
|
|
|
+ <if test="siteId != null"> and pcr.site_id = #{siteId}</if>
|
|
|
|
+ <if test="customerId != null"> and pcr.customer_id = #{customerId}</if>
|
|
|
|
+ <if test="payControlRecordDto.beginTime != null"> and pcr.create_date >= #{payControlRecordDto.beginTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
+ <if test="payControlRecordDto.endTime != null"> and pcr.create_date <= #{payControlRecordDto.endTime,jdbcType=TIMESTAMP}</if>
|
|
|
|
+ <if test="payControlRecordDto.meterCode != null and payControlRecordDto.meterCode != ''">
|
|
|
|
+ and sc.metercode =#{payControlRecordDto.meterCode}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ order by pcr.update_date desc
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="getRecentRecord" resultType="com.bz.smart_city.entity.pay.PayControlRecord">
|
|
<select id="getRecentRecord" resultType="com.bz.smart_city.entity.pay.PayControlRecord">
|
|
select
|
|
select
|