水利项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.1 KiB

1 year ago
<?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
1 year ago
FROM bs_sgc_df_dfrw ss
1 year ago
LEFT JOIN att_dike_base sj ON sj.dike_code = ss.dike_code
2 months ago
LEFT JOIN sys_xzqh sx ON sj.adcd = LEFT(sx.XZQHDM,6)
1 year ago
</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>
2 months ago
where task_id =#{taskId} and ss.`status`='0'
1 year ago
<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>
2 months ago
where task_id =#{taskId} and ss.`status`='1'
1 year ago
<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>
2 months ago
where task_id =#{taskId} and ss.`status`='2'
1 year ago
<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>
2 months ago
where task_id =#{taskId} and ss.`status`='2'
1 year ago
<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>