| | |
| | | </select> |
| | | <select id="unitStatistics" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo"> |
| | | SELECT temp.*, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位' AND belong_to = temp.belong_to) AS organTotal, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位' 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 AND cpcu.belong_to = temp.belong_to) AS partyMemberTotal |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位' |
| | | <if test="commonDto.communityId != null"> |
| | | AND community_id = #{commonDto.communityId} |
| | | </if> |
| | | AND belong_to = temp.belong_to) AS organTotal, |
| | | (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位' |
| | | <if test="commonDto.communityId != null"> |
| | | AND community_id = #{commonDto.communityId} |
| | | </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> |
| | | 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} |
| | |
| | | <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> |
| | | 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> |
| | | 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"> |