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.
70 lines
2.1 KiB
70 lines
2.1 KiB
<?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.sz.mapper.BsSgcSzAqrwMapper">
|
|
|
|
<sql id="info">
|
|
SELECT sx.`NAME`,
|
|
COUNT(1) num
|
|
FROM bs_sgc_sz_szrw ss
|
|
LEFT JOIN bs_sgc_sz_safe_jbxx sj ON sj.id = ss.WAGA_ID
|
|
LEFT JOIN sys_xzqh sx ON sj.adcd = sx.XZQHDM
|
|
</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`="3"
|
|
<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>
|
|
|
|
</mapper>
|
|
|