| | |
| | | resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo"> |
| | | SELECT |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE 1=1 |
| | | <if test="communityId != null"> |
| | | AND community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND belong_to = #{belongTo} |
| | | </if> |
| | |
| | | </if> |
| | | ) AS unitTotal, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位' |
| | | <if test="communityId != null"> |
| | | AND community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND belong_to = #{belongTo} |
| | |
| | | </if> |
| | | ) AS organTotal, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位' |
| | | <if test="communityId != null"> |
| | | AND community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND belong_to = #{belongTo} |
| | |
| | | </if> |
| | | ) AS businessTotal, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="communityId != null"> |
| | | AND m.community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND cpcu.belong_to = #{belongTo} |
| | |
| | | <select id="unitStatistics" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo"> |
| | | SELECT temp.*, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位' |
| | | <if test="commonDto.communityId != null"> |
| | | AND community_id = #{commonDto.communityId} |
| | | |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND belong_to = temp.belong_to) AS organTotal, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位' |
| | |
| | | </if> |
| | | AND belong_to = temp.belong_to) AS businessTotal, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND m.community_id = #{commonDto.communityId} |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND cpcu.belong_to = temp.belong_to) AS partyMemberTotal |
| | | FROM (SELECT belong_to,COUNT( id ) AS unitTotal FROM com_pb_check_unit WHERE 1=1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND community_id = #{commonDto.communityId} |
| | | </if> |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="commonDto.belongTo != null and commonDto.belongTo != ''"> |
| | | AND belong_to = #{commonDto.belongTo} |
| | | </if> |
| | |
| | | SELECT |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | AND cpcu.nature_name = '机关单位' |
| | | <if test="communityId != null"> |
| | | AND m.community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND cpcu.belong_to = #{belongTo} |
| | | </if> |
| | |
| | | ) AS organTotal, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | AND cpcu.nature_name = '企事业单位' |
| | | <if test="communityId != null"> |
| | | AND m.community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND cpcu.belong_to = #{belongTo} |
| | |
| | | </if> |
| | | ) AS businessTotal, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="communityId != null"> |
| | | AND m.community_id = #{communityId} |
| | | <if test="communityIds != null and communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="belongTo != null and belongTo != ''"> |
| | | AND cpcu.belong_to = #{belongTo} |
| | |
| | | <select id="pbStatisticsBelong" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo"> |
| | | SELECT temp.*, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND m.community_id = #{commonDto.communityId} |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND AND m.check_unit_id is not null AND cpcu.nature_name = '机关单位' AND cpcu.belong_to = temp.belong_to) AS organTotal, |
| | | (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND m.community_id = #{commonDto.communityId} |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND cpcu.nature_name = '企事业单位' AND cpcu.belong_to = temp.belong_to) AS businessTotal |
| | | FROM (SELECT cpcu.belong_to,COUNT( m.id ) AS partyMemberTotal FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND m.community_id = #{commonDto.communityId} |
| | | </if> |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="commonDto.belongTo != null and commonDto.belongTo != ''"> |
| | | AND cpcu.belong_to = #{commonDto.belongTo} |
| | | </if> |
| | |
| | | LEFT JOIN com_pb_check_unit AS cpcu ON m.check_unit_id = cpcu.id |
| | | WHERE |
| | | m.audit_result = 1 |
| | | <if test="commonDto.communityId != null"> |
| | | AND m.community_id = #{commonDto.communityId} |
| | | <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0"> |
| | | AND m.community_id IN |
| | | <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="commonDto.belongTo != null and commonDto.belongTo != ''"> |
| | | AND cpcu.belong_to = #{commonDto.belongTo} |