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

58 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.BsSgcSzBzhjsMapper">
<sql id="info">
select *
from bs_sgc_sz_bzhjs sf
left join att_waga_base sj on sf.waga_code = sj.waga_code
</sql>
<resultMap id="col" type="BsSgcSzBzhjs">
<id property="id" column="id"/>
<result property="wagaCode" column="waga_code"/>
<result property="wagaName" column="waga_name"/>
<result property="wagaType" column="waga_type"/>
<result property="unit" column="ADM_DEP"/>
<result property="engScal" column="eng_scal"/>
<result property="adcd" column="adcd"/>
</resultMap>
<select id="getList" resultMap="col">
<bind name="pageNum" value="(pageNum-1)*pageSize"></bind>
<include refid="info"></include>
<where>
<if test="wagaType!=null and wagaType!=''">
and sj.waga_type = #{wagaType}
</if>
<if test="wagaName!=null and wagaName!=''">
and sj.waga_name LIKE concat('%',#{wagaName},'%')
</if>
<if test="adcd!=null and adcd !=''">
and sj.adcd like concat(#{adcd},'%')
</if>
<if test="id!=null and id!=''">
and sf.id=#{id}
</if>
<if test="wagaCode != null and wagaCode != ''">
and sj.waga_code like concat('%',#{wagaCode},'%')
</if>
and sj.EXPR_DATE is null
</where>
order by sf.create_time desc LIMIT #{pageNum},#{pageSize};
</select>
<select id="getBarChart" resultType="java.util.Map">
SELECT WAGA_TYPE as type, xzqh.NAME as name, COUNT(*) as num
FROM att_waga_base waga
INNER JOIN bs_sgc_sz_bzhjs sf ON sf.waga_code = waga.WAGA_CODE
left join sys_xzqh xzqh on LEFT(waga.adcd,4)=LEFT(XZQHDM,4) and RIGHT(xzqh.XZQHDM,8)='00000000'
GROUP BY WAGA_TYPE, LEFT(adcd,4)
</select>
</mapper>