| | |
| | | </update> |
| | | |
| | | <!--根据流量计编号获取未删除的流量计数量--> |
| | | <select id="getRecordCountOfFlowmeter" resultType="java.lang.Integer"> |
| | | <select id="getRecordCountOfFlowmeterByCode" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) AS recordCountOfFlowmeter FROM pr_flowmeter WHERE deleted = 0 AND id = ${flowmeterId} |
| | | </select> |
| | | |
| | | <!--根据流量计编号 或者 在线状态 获取未删除的流量计数量 --> |
| | | <select id="getRecordCountOfFlowMeterByOthers" resultType="_integer"> |
| | | SELECT COUNT(*) AS recordCountOfFlowmeter FROM pr_flowmeter |
| | | <where> |
| | | deleted = 0 AND |
| | | <if test="code != null"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="onlineState != null "> |
| | | onlineState = #{onlineState,jdbcType=TINYINT} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据流量计编号 或者 在线状态 获取未删除的流量计记录 --> |
| | | <select id="getFlowMeters" resultType="com.dy.pipIrrGlobal.voPr.VoFlowMeter"> |
| | | select (@i:=@i+1) AS id, |
| | | pfm.code AS code, |
| | | pfm.onlineState AS onlineState, |
| | | pfmt.`name` AS `name`, |
| | | pfm.operateDt AS operateDt |
| | | from pr_flowmeter pfm |
| | | inner join pr_monitoring_flowmeter pmofl on pmofl.flowmeterId = pfm.id |
| | | inner join pr_flow_monitoring pfmt on pfmt.id = pmofl.monitoringId, |
| | | (SELECT @i:=0) AS itable |
| | | <where> |
| | | pfm.deleted = 0 AND pfmt.deleted = 0 AND pmofl.operateType = 1 |
| | | <if test="code != null"> |
| | | AND code = #{code,jdbcType=VARCHAR} |
| | | </if> |
| | | <if test="onlineState != null "> |
| | | AND onlineState = #{onlineState,jdbcType=TINYINT} |
| | | </if> |
| | | </where> |
| | | ORDER BY pfm.operateDt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |