| | |
| | | </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> |
| | | |
| | | <!--为指定(阀控器地址、水卡编号、无关阀记录)开关阀最新记录添加关阀时间,使之不在未关阀记录中显示--> |