<?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.zjrs.ggfw.portal.entity.VRsSyXxlxMapper">

    <select id="getZcfgYwztCntList" parameterType="map" resultType="map">
        select aaa102 "code",aaa103 "detail",cnt "cnt" from(
			select aaa102,aaa103,cnt,case when aaa102='12' and cnt>0 then 1 
			when aaa102!='12' or cnt=0 then cnt end pxh from (
				select a.aaa102,a.aaa103,(select count(1) from v_rs_sy_xxlx where 
				fbqd like '%4%'  
				and ywzt like a.aaa102||'%') cnt 
				from v_ggfw_dict a where a.aaa100='RS_SX_SHCONFIG_YWZT')) 
		order by pxh desc,to_number(aaa102)
    </select>
</mapper>
