<?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="org.springblade.modules.mountainrain.mapper.MountainrainMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="mountainrainResultMap" type="org.springblade.modules.mountainrain.entity.Mountainrain">
|
<result column="id" property="id"/>
|
<result column="crainfall" property="crainfall"/>
|
<result column="cenconding" property="cenconding"/>
|
<result column="gohour" property="gohour"/>
|
<result column="gthour" property="gthour"/>
|
<result column="gshour" property="gshour"/>
|
<result column="imohour" property="imohour"/>
|
<result column="imthour" property="imthour"/>
|
<result column="imshour" property="imshour"/>
|
</resultMap>
|
|
<!--山洪预警全查-->
|
<resultMap id="ResultMap" type="org.springblade.modules.mountainrain.vo.MountainrainSSVO">
|
<result column="id" property="id"/>
|
<result column="cenconding" property="cenconding"/>
|
<result column="aconding" property="aconding"/>
|
<result column="township" property="township"/>
|
<result column="village" property="village"/>
|
<result column="village_group" property="village_group"/>
|
<result column="dj" property="dj"/>
|
<result column="bw" property="bw"/>
|
<result column="fyear" property="fyear"/>
|
<result column="tyear" property="tyear"/>
|
<result column="oyear" property="oyear"/>
|
<result column="county" property="county"/>
|
<result column="crainfall" property="crainfall"/>
|
<result column="arainfall" property="arainfall"/>
|
<result column="gohour" property="gohour"/>
|
<result column="gthour" property="gthour"/>
|
<result column="gshour" property="gshour"/>
|
<result column="imohour" property="imohour"/>
|
<result column="imthour" property="imthour"/>
|
<result column="imshour" property="imshour"/>
|
</resultMap>
|
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="mountainrainResultMaps" type="org.springblade.modules.mountainrain.vo.MountainrainsVO">
|
<result column="c" property="c"/>
|
<result column="cenconding" property="cenconding"/>
|
<result column="b" property="b"/>
|
<result column="aconding" property="aconding"/>
|
</resultMap>
|
|
|
<resultMap id="mountainrainResultMapcInfo" type="org.springblade.modules.mountainrain.vo.MountainrainsCVO">
|
<result column="c" property="c"/>
|
<result column="cenconding" property="cenconding"/>
|
<result column="crainfall" property="crainfall"/>
|
<result column="gohour" property="gohour"/>
|
<result column="gthour" property="gthour"/>
|
<result column="gshour" property="gshour"/>
|
<result column="imohour" property="imohour"/>
|
<result column="imthour" property="imthour"/>
|
<result column="imshour" property="imshour"/>
|
<result column="drp1" property="drp1"/>
|
<result column="drp3" property="drp3"/>
|
<result column="drp6" property="drp6"/>
|
<result column="township" property="township"/>
|
<result column="village" property="village"/>
|
<result column="village_group" property="village_group"/>
|
<result column="dj" property="dj"/>
|
<result column="bw" property="bw"/>
|
<result column="county" property="county"/>
|
<result column="fyear" property="fyear"/>
|
<result column="tyear" property="tyear"/>
|
<result column="oyear" property="oyear"/>
|
<result column="dyp" property="dyp"/>
|
</resultMap>
|
|
<resultMap id="mountainrainResultMapaInfo" type="org.springblade.modules.mountainrain.vo.MountainrainsAVO">
|
<result column="c" property="c"/>
|
<result column="aconding" property="aconding"/>
|
<result column="arainfall" property="arainfall"/>
|
<result column="gohour" property="gohour"/>
|
<result column="gthour" property="gthour"/>
|
<result column="gshour" property="gshour"/>
|
<result column="imohour" property="imohour"/>
|
<result column="imthour" property="imthour"/>
|
<result column="imshour" property="imshour"/>
|
<result column="drp1" property="drp1"/>
|
<result column="drp3" property="drp3"/>
|
<result column="drp6" property="drp6"/>
|
<result column="township" property="township"/>
|
<result column="village" property="village"/>
|
<result column="village_group" property="village_group"/>
|
<result column="dj" property="dj"/>
|
<result column="bw" property="bw"/>
|
<result column="county" property="county"/>
|
<result column="fyear" property="fyear"/>
|
<result column="tyear" property="tyear"/>
|
<result column="oyear" property="oyear"/>
|
<result column="dyp" property="dyp"/>
|
</resultMap>
|
|
<resultMap id="DPFX" type="org.springblade.modules.mountainrain.vo.MountainrainsDPVO">
|
<result column="sttp" property="sttp"/>
|
<result column="count" property="count"/>
|
</resultMap>
|
|
|
<select id="selectMountainrainPage" resultMap="mountainrainResultMap">
|
select * from blade_mountainrain
|
</select>
|
<select id="selectNoticePage" resultMap="ResultMap">
|
SELECT
|
mr.id,
|
mr.cenconding,
|
mr.township,
|
mr.village,
|
mr.village_group as village_group,
|
Convert(decimal(18,4),mr.dj) as dj,
|
Convert(decimal(18,4),mr.bw) as bw,
|
mr.fyear,
|
mr.tyear,
|
mr.oyear,
|
mr.county,
|
mr.crainfall,
|
isnull(mr.gohour,0) gohour,
|
isnull(mr.gthour,0) gthour,
|
isnull(mr.gshour,0) gshour,
|
isnull(mr.imohour,0) imohour,
|
isnull(mr.imthour,0) imthour,
|
isnull(mr.imshour,0) imshour
|
FROM
|
dbo.blade_mountain mr
|
where 1=1
|
<if test="mountainrainSSVO.crainfall!=null">
|
and mr.crainfall like '%' + #{mountainrainSSVO.crainfall} + '%'
|
</if>
|
<if test="mountainrainSSVO.arainfall!=null">
|
and mr.arainfall like '%' + #{mountainrainSSVO.arainfall} + '%'
|
</if>
|
<if test="mountainrainSSVO.township!=null">
|
and mr.township like '%' + #{mountainrainSSVO.township} + '%'
|
</if>
|
<if test="mountainrainSSVO.village_group!=null">
|
and mr.village_group like '%' + #{mountainrainSSVO.village_group} + '%'
|
</if>
|
<if test="mountainrainSSVO.county!=null">
|
and mr.county like '%' + #{mountainrainSSVO.county} + '%'
|
</if>
|
<if test="mountainrainSSVO.village!=null">
|
and mr.village like '%' + #{mountainrainSSVO.village} + '%'
|
</if>
|
ORDER BY mr.cenconding
|
</select>
|
<select id="selectInfo" resultMap="ResultMap">
|
SELECT
|
mr.id,
|
mr.cenconding,
|
mr.aconding,
|
mr.township,
|
mr.village,
|
mr.village_group as village_group,
|
mr.dj,
|
mr.bw,
|
mr.fyear,
|
mr.tyear,
|
mr.oyear,
|
mr.county,
|
mr.crainfall,
|
mr.arainfall,
|
isnull(mr.gohour,0) gohour,
|
isnull(mr.gthour,0) gthour,
|
isnull(mr.gshour,0) gshour,
|
isnull(mr.imohour,0) imohour,
|
isnull(mr.imthour,0) imthour,
|
isnull(mr.imshour,0) imshour
|
FROM
|
dbo.blade_mountain mr
|
where mr.id=#{id}
|
</select>
|
|
|
<select id="selectcInfos" resultMap="mountainrainResultMapcInfo">
|
SELECT
|
cs.id,
|
cs.cenconding,
|
cs.crainfall,
|
isnull(cs.gohour,0) gohour,
|
isnull(cs.gthour,0) gthour,
|
isnull(cs.gshour,0) gshour,
|
isnull(cs.imohour,0) imohour,
|
isnull(cs.imthour,0) imthour,
|
isnull(cs.imshour,0) imshour,
|
css.drp1,
|
cs2.drp3,
|
cs6.drp6,
|
isnull(csd.dyp,0) dyp,
|
cs.township,
|
cs.village,
|
cs.village_group,
|
cs.dj,
|
cs.bw,
|
cs.county,
|
isnull(cs.fyear,0) as fyear ,
|
isnull(cs.tyear,0) as tyear,
|
isnull(cs.oyear,0) as oyear
|
FROM
|
( SELECT id,cenconding,crainfall,township, village, village_group, dj, bw,county,fyear,tyear,oyear,gohour,gthour,gshour,imohour,imthour,imshour FROM blade_mountain ) cs
|
INNER JOIN (
|
SELECT
|
ISNULL( SUM ( str.DRP ), 0 ) AS drp1,
|
STCD
|
FROM
|
dbo.ST_PPTN_R str
|
WHERE
|
str.TM >#{dateEnd1}
|
AND str.TM <=#{times}
|
GROUP BY
|
STCD
|
) css ON css.STCD = cs.cenconding
|
FULL JOIN (
|
SELECT
|
ISNULL( SUM ( s.DRP ), 0 ) AS drp3,
|
STCD
|
FROM
|
dbo.ST_PPTN_R s
|
WHERE
|
s.TM >#{dateEnd3}
|
AND s.TM <=#{times}
|
GROUP BY
|
STCD
|
) cs2 ON cs2.STCD = cs.cenconding
|
FULL JOIN (
|
SELECT
|
ISNULL( SUM ( strs.DRP ), 0 ) AS drp6,
|
STCD
|
FROM
|
dbo.ST_PPTN_R strs
|
WHERE
|
strs.TM >#{dateEnd6}
|
AND strs.TM <=#{times}
|
GROUP BY
|
STCD
|
) cs6 ON cs6.STCD = cs.cenconding
|
FULL JOIN (
|
SELECT
|
SUM( strd.DRP ) AS dyp,STCD
|
FROM
|
dbo.ST_PPTN_R strd
|
WHERE
|
strd.TM >#{timess}
|
AND strd.TM <=#{times}
|
GROUP BY STCD
|
) csd on csd.STCD=cs.cenconding
|
</select>
|
</mapper>
|