Browse Source

【五大图层】支持"其他"类型志愿者的查询

dev
wangxianzhang 3 years ago
parent
commit
c5de446d1d
  1. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  2. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  3. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -115,9 +115,27 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("search")String search,
@Param("resiCategory")String resiCategory);
Integer countVolunteersWithoutVolCategory(@Param("customerId")String customerId,
@Param("agencyId")String agencyId,
@Param("staffOrgIds")String staffOrgIds,
@Param("search")String search);
List<IcResiUserEntity> listVolunteersByCategory(@Param("customerId")String customerId,
@Param("agencyId")String agencyId,
@Param("staffOrgIds")String staffOrgIds,
@Param("search")String search,
@Param("resiCategory")String resiCategory);
/**
* 列出没有志愿者类别的志愿者
* @param customerId
* @param agencyId
* @param staffOrgIds
* @param search
* @return
*/
List<IcResiUserEntity> listVolunteersWithoutVolCategory(@Param("customerId")String customerId,
@Param("agencyId")String agencyId,
@Param("staffOrgIds")String staffOrgIds,
@Param("search")String search);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -857,11 +857,21 @@ public class EpmetUserServiceImpl implements EpmetUserService {
@Override
public Integer countVolunteers(String customerId, String agencyId, String staffOrgIds, String search, String resiCategory) {
if ("others".equals(resiCategory)) {
//others需要特殊处理,它是指那些勾选了是志愿者,但是没有选择具体志愿者类型的居民,实际上志愿者类型里面没有others这个类别的
return icResiUserDao.countVolunteersWithoutVolCategory(customerId, agencyId, staffOrgIds, search);
} else {
return icResiUserDao.countVolunteersByCategory(customerId, agencyId, staffOrgIds, search, resiCategory);
}
}
@Override
public List<IcResiUserEntity> listVolunteers(String customerId, String agencyId, String staffOrgIds, String search, String resiCategory) {
if ("others".equals(resiCategory)) {
//others需要特殊处理,它是指那些勾选了是志愿者,但是没有选择具体志愿者类型的居民,实际上志愿者类型里面没有others这个类别的
return icResiUserDao.listVolunteersWithoutVolCategory(customerId, agencyId, staffOrgIds, search);
} else {
return icResiUserDao.listVolunteersByCategory(customerId, agencyId, staffOrgIds, search, resiCategory);
}
}
}

43
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -188,6 +188,7 @@
from ic_resi_user resi
inner join ic_volunteer vol on (resi.ID = vol.IC_RESI_USER and vol.DEL_FLAG = '0')
where resi.DEL_FLAG = '0'
and resi.IS_VOLUNTEER = '1'
and resi.CUSTOMER_ID = #{customerId}
<if test="agencyId != null and agencyId != ''">
and resi.AGENCY_ID = #{agencyId}
@ -202,11 +203,32 @@
</select>
<select id="countVolunteersWithoutVolCategory" resultType="java.lang.Integer">
select count(0) from (select resi.ID, resi.NAME, resi.ID_CARD, resi.BUILD_ID, vol.VOLUNTEER_CATEGORY volunteerCategory
from ic_resi_user resi
left join ic_volunteer vol on (resi.ID = vol.IC_RESI_USER and vol.DEL_FLAG = '0')
where resi.DEL_FLAG = '0'
and resi.IS_VOLUNTEER = '1'
and resi.CUSTOMER_ID = #{customerId}
<if test="agencyId != null and agencyId != ''">
and resi.AGENCY_ID = #{agencyId}
</if>
<if test="staffOrgIds != null and staffOrgIds != ''">
and resi.PIDS like CONCAT(#{staffOrgIds},'%')
</if>
<if test="search != null and search != ''">
and resi.NAME like CONCAT('%',#{search},'%')
</if>
having volunteerCategory is null
or volunteerCategory = '') t
</select>
<select id="listVolunteersByCategory" resultType="com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity">
select resi.ID, resi.NAME, resi.ID_CARD, resi.BUILD_ID
from ic_resi_user resi
inner join ic_volunteer vol on (resi.ID = vol.IC_RESI_USER and vol.DEL_FLAG = '0')
where resi.DEL_FLAG = '0'
and resi.IS_VOLUNTEER = '1'
and resi.CUSTOMER_ID = #{customerId}
<if test="agencyId != null and agencyId != ''">
and resi.AGENCY_ID = #{agencyId}
@ -220,4 +242,25 @@
</if>
</select>
<!--列出没有志愿者类别的志愿者-->
<select id="listVolunteersWithoutVolCategory" resultType="com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity">
select resi.ID, resi.NAME, resi.ID_CARD, resi.BUILD_ID, vol.VOLUNTEER_CATEGORY volunteerCategory
from ic_resi_user resi
left join ic_volunteer vol on (resi.ID = vol.IC_RESI_USER and vol.DEL_FLAG = '0')
where resi.DEL_FLAG = '0'
and resi.IS_VOLUNTEER = '1'
and resi.CUSTOMER_ID = #{customerId}
<if test="agencyId != null and agencyId != ''">
and resi.AGENCY_ID = #{agencyId}
</if>
<if test="staffOrgIds != null and staffOrgIds != ''">
and resi.PIDS like CONCAT(#{staffOrgIds},'%')
</if>
<if test="search != null and search != ''">
and resi.NAME like CONCAT('%',#{search},'%')
</if>
having volunteerCategory is null
or volunteerCategory = ''
</select>
</mapper>

Loading…
Cancel
Save