水利项目
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.
 
 

57 lines
2.2 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.BsSgcSzBzbpMapper">
<resultMap type="com.kms.yg.sz.domain.BsSgcSzBzbp" id="Result">
<id property="id" column="id" />
<result property="wagaName" column="waga_name" />
<result property="adcd" column="adcd" />
<result property="number" column="number" />
<result property="oneType" column="oneType" />
<result property="twoType" column="twoType" />
<result property="threeType" column="threeType" />
<result property="fourType" column="fourType" />
<result property="wagaCode" column="waga_code" />
</resultMap>
<select id="selectList1" resultMap="Result">
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
SELECT waga_name, adcd, COUNT(1) number,waga_code,
COUNT(CASE WHEN type = 0 THEN 1 END) AS oneType,
COUNT(CASE WHEN type= 1 THEN 1 END) AS twoType,
COUNT(CASE WHEN type = 2 THEN 1 END) AS threeType,
COUNT(CASE WHEN type = 3 THEN 1 END) AS fourType
FROM bs_sgc_sz_bzbp
<where>
<if test="wagaName != null and wagaName != ''">
waga_name like concat('%', #{wagaName}, '%')
</if>
<if test="adcd != null and adcd != ''">
and adcd like concat(#{adcd},'%')
</if>
</where>
GROUP BY waga_code
ORDER BY create_time DESC
LIMIT #{pageNum}, #{pageSize}
</select>
<select id="getStatistics" resultType="java.util.Map">
SELECT qh.NAME as name,count(1) as num
FROM bs_sgc_sz_bzbp bp
inner join sys_xzqh qh on bp.adcd= LEFT(qh.XZQHDM,6) AND RIGHT(qh.XZQHDM, 6) = '000000'
<where>
<if test="wagaName != null and wagaName != ''">
waga_name like concat('%', #{wagaName}, '%')
</if>
<if test="adcd != null and adcd != ''">
and adcd like concat(#{adcd},'%')
</if>
</where>
GROUP BY adcd
</select>
</mapper>