123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.com.victorysoft.business.cyyzs.dao.FailureReasonDao">
- <update id="updateDetails">
- update water_failure_reason
- set gylx = #{gylx, jdbcType=VARCHAR},
- fsyz_ck = #{fsyzCk, jdbcType=VARCHAR},
- jgyz = #{jgyz, jdbcType=VARCHAR},
- fgq = #{fgq, jdbcType=VARCHAR},
- psq = #{psq, jdbcType=VARCHAR},
- xjf = #{xjf, jdbcType=VARCHAR},
- mdgj = #{mdgj, jdbcType=VARCHAR},
- mgz = #{mgz, jdbcType=VARCHAR},
- is_gzdx = #{isGzdx, jdbcType=VARCHAR},
- kzrq = #{kzrq, jdbcType=DATE},
- sxrq = #{sxrq, jdbcType=DATE},
- last_is_xjcg = #{lastIsXjcg, jdbcType=VARCHAR}
- where
- jh = #{jh, jdbcType=VARCHAR} and to_char(rq, 'yyyy-mm-dd') = to_char(#{rq, jdbcType=DATE}, 'yyyy-mm-dd')
- </update>
- <select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails">
- select
- a.rq, a.dwdm, a.dydm, a.jh, a.gylx, b.flag_name gylx_name,
- case when fsyz_ck = 'Y' then '是' when fsyz_ck is null then '' else '否' end fsyz_ck,
- case when jgyz = 'Y' then '是' when jgyz is null then '' else '否' end jgyz,
- case when fgq = 'Y' then '是' when fgq is null then '' else '否' end fgq,
- case when psq = 'Y' then '是' when psq is null then '' else '否' end psq,
- case when xjf = 'Y' then '是' when xjf is null then '' else '否' end xjf,
- case when mdgj = 'Y' then '是' when mdgj is null then '' else '否' end mdgj,
- case when mgz = 'Y' then '是' when mgz is null then '' else '否' end mgz,
- case when is_gzdx = 'Y' then '是' when is_gzdx is null then '' else '否' end is_gzdx,
- case when last_is_xjcg = 'Y' then '是' when last_is_xjcg is null then '' else '否' end last_is_xjcg,
- gjwhxms, zyrj, kzrq, sxrq, yxq, sxyy, qgzfh, zsltbqk,
- d.unitname dwmc, c.blockname dymc,
- rownum xh
- from
- water_failure_reason a
- left join sys_flag b on a.gylx = b.flag_code
- left join sys_blockinfo c on a.dydm = c.blockcode
- left join sys_unitinfo d on a.dwdm = d.unitcode
- left join water_well_basic e on a.jh = e.jh
- where
- 1 = 1
- <if test="jh != null and jh != ''"> and a.jh = #{jh}</if>
- <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
- <if test="yclx != null and yclx != ''"> and e.yclx = #{yclx}</if>
- <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
- <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
- </select>
- <select id="selectListGroupGylx" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
- select
- a.*, rownum xh
- from (
- select
- a.gylx,
- (select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
- sum(case when a.fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck,
- sum(case when a.jgyz = 'Y' then 1 else 0 end ) jgyz,
- sum(case when a.fgq = 'Y' then 1 else 0 end ) fgq,
- sum(case when a.psq = 'Y' then 1 else 0 end ) psq,
- sum(case when a.xjf = 'Y' then 1 else 0 end ) xjf,
- sum(case when a.mdgj = 'Y' then 1 else 0 end ) mdgj,
- sum(case when a.mgz = 'Y' then 1 else 0 end ) mgz
- from
- water_failure_reason a
- left join water_well_basic b on a.jh = b.jh
- where
- 1 = 1
- <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
- <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
- <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
- <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
- group by
- a.gylx
- ) a
- </select>
- <select id="selectListGroupYclx" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
- select
- a.*, rownum xh
- from (
- select
- b.yclx,
- (select flag_name from sys_flag where flag_code = b.yclx) yclx_name,
- sum(case when fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck,
- sum(case when jgyz = 'Y' then 1 else 0 end ) jgyz,
- sum(case when fgq = 'Y' then 1 else 0 end ) fgq,
- sum(case when psq = 'Y' then 1 else 0 end ) psq,
- sum(case when xjf = 'Y' then 1 else 0 end ) xjf,
- sum(case when mdgj = 'Y' then 1 else 0 end ) mdgj,
- sum(case when mgz = 'Y' then 1 else 0 end ) mgz
- from
- water_failure_reason a
- left join water_well_basic b on a.jh = b.jh
- where
- 1 = 1
- <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
- <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
- <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
- <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
- group by
- b.yclx
- )
- </select>
- <select id="getBarData" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
- select
- a.gylx,
- (select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
- sum(case when fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck
- from
- water_failure_reason a
- left join water_well_basic b on a.jh = b.jh
- where
- 1 = 1
- <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
- <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
- <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
- <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
- group by
- a.gylx
- </select>
- <select id="getPieData" resultType="org.apache.commons.collections.map.CaseInsensitiveMap">
- select
- sum(case when fsyz_ck = 'Y' then 1 else 0 end ) "油管腐蚀严重或穿孔",
- sum(case when jgyz = 'Y' then 1 else 0 end ) "油管结垢严重",
- sum(case when fgq = 'Y' then 1 else 0 end ) "封隔器",
- sum(case when psq = 'Y' then 1 else 0 end ) "配水器",
- sum(case when xjf = 'Y' then 1 else 0 end ) "洗井阀",
- sum(case when mdgj = 'Y' then 1 else 0 end ) "锚定工具",
- sum(case when mgz = 'Y' then 1 else 0 end ) "埋管柱"
- from
- water_failure_reason a
- left join water_well_basic b on a.jh = b.jh
- where
- 1 = 1
- <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
- <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
- <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
- <if test="dwdm != null and dwdm != ''"> and a.dwdm in (select unitcode from sys_unitinfo start with unitcode = #{dwdm} connect by p_unitcode = prior unitcode) </if>
- </select>
- <select id="selectDetailsOne" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails">
- select
- *
- from
- water_failure_reason
- where
- 1 = 1
- <if test="jh != null and jh != ''"> and jh = #{jh}</if>
- <if test="rq != null and rq != ''"> and to_char(rq, 'yyyy-mm-dd') = #{rq}</if>
- </select>
- </mapper>
|