|
|
|
<?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="com.kms.yg.df.mapper.BsSgcDfAqrwMapper">
|
|
|
|
|
|
|
|
<sql id="info">
|
|
|
|
SELECT sx.`NAME`,
|
|
|
|
COUNT(1) num
|
|
|
|
FROM bs_sgc_df_dfrw ss
|
|
|
|
LEFT JOIN att_dike_base sj ON sj.dike_code = ss.dike_code
|
|
|
|
LEFT JOIN sys_xzqh sx ON sj.adcd = LEFT(sx.XZQHDM,6)
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="NumDto" type="NumDto">
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="num" column="num"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="getZeroNum" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and ss.`status`='0'
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getOneNum" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and ss.`status`='1'
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getTwoNum" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and ss.`status`='2'
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getThreeNum" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and ss.`status`='2'
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getNum" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId}
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getOne" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and sj.`security_category`="0"
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getTwo" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and sj.`security_category`="1"
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="getThree" resultMap="NumDto">
|
|
|
|
<include refid="info"></include>
|
|
|
|
where task_id =#{taskId} and sj.`security_category`="2"
|
|
|
|
<if test="layer==1">
|
|
|
|
GROUP BY LEFT(sj.adcd,4)
|
|
|
|
</if>
|
|
|
|
<if test="layer==2">
|
|
|
|
GROUP BY sj.adcd
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|