|  |  |  | 
|---|
|  |  |  | oh.cl_total_amount      AS closeTotalAmount | 
|---|
|  |  |  | FROM rm_open_close_valve_last oh | 
|---|
|  |  |  | LEFT JOIN pr_intake inta ON inta.id = oh.intake_id | 
|---|
|  |  |  | LEFT JOIN ba_client cl ON cl.id = oh.client_id | 
|---|
|  |  |  | LEFT JOIN se_client cl ON cl.id = oh.client_id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="intakeId != null and intakeId > 0"> | 
|---|
|  |  |  | AND oh.intake_id = #{intakeId} | 
|---|
|  |  |  | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据开阀方式获取操作次数--> | 
|---|
|  |  |  | <select id="getCountByOpenType" resultType="java.lang.Integer"> | 
|---|
|  |  |  | SELECT COUNT(*) AS recordCount | 
|---|
|  |  |  | <select id="getCountByOpenType" resultType="com.dy.pipIrrGlobal.voSt.VoCountOfOpenType"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | COUNT(*) AS openTypeCount, | 
|---|
|  |  |  | op_type AS openType | 
|---|
|  |  |  | FROM rm_open_close_valve_history | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="idStart != nul"> | 
|---|
|  |  |  | id <![CDATA[>=]]> #{idStart} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="idEnd != nul"> | 
|---|
|  |  |  | AND id <![CDATA[<=]]> #{idEnd} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="openType != null"> | 
|---|
|  |  |  | AND op_type = #{openType} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStart != null and timeStop != null"> | 
|---|
|  |  |  | AND op_dt BETWEEN #{timeStart} AND #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | group by op_type | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--根据关阀方式获取操作次数--> | 
|---|
|  |  |  | <select id="getCountByCloseType" resultType="java.lang.Integer"> | 
|---|
|  |  |  | SELECT COUNT(*) AS recordCount | 
|---|
|  |  |  | <select id="getCountByCloseType" resultType="com.dy.pipIrrGlobal.voSt.VoCountOfCloseType"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | COUNT(*) AS closeTypeCount, | 
|---|
|  |  |  | cl_type AS closeType | 
|---|
|  |  |  | FROM rm_open_close_valve_history | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | <if test="idStart != nul"> | 
|---|
|  |  |  | id <![CDATA[>=]]> #{idStart} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="idEnd != nul"> | 
|---|
|  |  |  | AND id <![CDATA[<=]]> #{idEnd} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="closeType != null"> | 
|---|
|  |  |  | AND cl_type = #{closeType} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStart != null and timeStop != null"> | 
|---|
|  |  |  | AND cl_dt BETWEEN #{timeStart} AND #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | group by cl_type | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示--> | 
|---|