| | |
| | | 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 |
| | | SELECT COUNT(*) AS recordCountOfFlowmeter |
| | | from pr_flowmeter pfm |
| | | Left join pr_monitoring_flowmeter pmofl on pmofl.flowmeterId = pfm.id |
| | | Left join pr_flow_monitoring pfmt on pfmt.id = pmofl.monitoringId |
| | | <where> |
| | | deleted = 0 AND |
| | | <if test="code != null"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | pfm.deleted = 0 AND pfmt.deleted = 0 |
| | | <if test = "code != null and code !=''"> |
| | | AND pfm.code like CONCAT('%',#{code},'%') |
| | | </if> |
| | | <if test="onlineState != null "> |
| | | onlineState = #{onlineState,jdbcType=TINYINT} |
| | | AND pfm.onlineState = #{onlineState} |
| | | </if> |
| | | </where> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--根据流量计编号 或者 在线状态 获取未删除的流量计记录 --> |
| | | <!--根据流量计编号 或者 在线状态 获取未删除的绑定的流量计记录 --> |
| | | <select id="getFlowMeters" resultType="com.dy.pipIrrGlobal.voPr.VoFlowMeter"> |
| | | select (@i:=@i+1) AS id, |
| | | select CAST(pfm.id AS char) 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 |
| | | Left join pr_monitoring_flowmeter pmofl on pmofl.flowmeterId = pfm.id |
| | | Left join pr_flow_monitoring pfmt on pfmt.id = pmofl.monitoringId |
| | | <where> |
| | | pfm.deleted = 0 AND pfmt.deleted = 0 AND pmofl.operateType = 1 |
| | | <if test="code != null"> |
| | | AND code = #{code,jdbcType=VARCHAR} |
| | | pfm.deleted = 0 AND pfmt.deleted = 0 |
| | | <if test = "code != null and code !=''"> |
| | | AND pfm.code like CONCAT('%',#{code},'%') |
| | | </if> |
| | | <if test="onlineState != null "> |
| | | AND onlineState = #{onlineState,jdbcType=TINYINT} |
| | | AND pfm.onlineState = #{onlineState} |
| | | </if> |
| | | </where> |
| | | ORDER BY pfm.operateDt DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${pageCurr}, ${pageSize} |
| | | </if> |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectAll" resultMap="BaseResultMap"> |
| | | <!--@mbg.generated--> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from pr_flowmeter pfm |
| | | where deleted != 1 |
| | | </select> |
| | | </mapper> |