| New file |
| | |
| | | <?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="org.springblade.modules.partyOrganization.mapper.PartyOrganizationMapper"> |
| | | |
| | | |
| | | <select id="getPage" resultType="org.springblade.modules.partyOrganization.vo.PartyOrganizationVO"> |
| | | SELECT |
| | | DISTINCT |
| | | jpo.*, |
| | | IFNULL(countTable.memberCount ,0) as memberCount |
| | | FROM |
| | | jczz_party_organization jpo |
| | | LEFT JOIN ( SELECT COUNT(*) memberCount, organization_id FROM jczz_party_organization_member WHERE is_deleted = 0 GROUP BY organization_id ) countTable ON countTable.organization_id = jpo.id |
| | | left join jczz_party_organization_member jpom ON jpom.organization_id = jpo.id |
| | | left join jczz_household jh ON jh.id = jpom.household_id |
| | | WHERE |
| | | jpo.is_deleted = 0 |
| | | |
| | | <if test="vo.organizationName != null and vo.organizationName != ''"> |
| | | AND jpo.organization_name LIKE CONCAT('%',#{vo.organizationName},'%') |
| | | </if> |
| | | <if test="vo.areaId != null and vo.areaId !='' "> |
| | | AND jpo.area_id like concat('%',#{vo.areaId},'%') |
| | | </if> |
| | | <if test="vo.name != null and vo.name != ''"> |
| | | AND(jh.name LIKE CONCAT('%',#{vo.name},'%') OR jpo.charge_person LIKE CONCAT('%',#{vo.name},'%')) |
| | | </if> |
| | | ORDER BY |
| | | jpo.sort ASC |
| | | </select> |
| | | </mapper> |