| | |
| | | package com.panzhihua.service_dangjian.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.partybuilding.PagePartyOrganizationVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.PageMemberForInviteDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; |
| | | import com.panzhihua.common.model.vos.PartyMemberListExcelVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.excel.ComDataStatisticsMemberExcelVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComPbMemberDAO extends BaseMapper<ComPbMemberDO> { |
| | | // -------------------动态模板------------- |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "o.`name` orgName,\n" + |
| | | "m.org_id,\n"+ |
| | | "m.id_card,\n"+ |
| | | "m.`id`,\n" + |
| | | "u.phone,\n" + |
| | | "m.`name`,\n" + |
| | | "m.photo_path,\n" + |
| | | "TIMESTAMPDIFF(\n" + |
| | | "YEAR,\n" + |
| | | "m.employment_time,\n" + |
| | | "DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%s' )) partyAge,\n" + |
| | | "m.join_time,\n" + |
| | | "m.employment_time,\n" + |
| | | "CASE\n" + |
| | | "WHEN u.id_card IS NULL THEN\n" + |
| | | "'未注册' ELSE '已注册' \n" + |
| | | "END STATUS \n" + |
| | | "FROM\n" + |
| | | "com_pb_member m\n" + |
| | | "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" + |
| | | "LEFT JOIN com_pb_org o ON m.org_id = o.id"+ |
| | | " <where>" + |
| | | "<if test='pagePartyOrganizationVO.orgName != null and pagePartyOrganizationVO.orgName.trim() != ""'>" + |
| | | "and o.name=#{pagePartyOrganizationVO.orgName}"+ |
| | | " </if> " + |
| | | "<if test='pagePartyOrganizationVO.account != null and pagePartyOrganizationVO.account.trim() != ""'>" + |
| | | "and u.phone=#{pagePartyOrganizationVO.account}"+ |
| | | " </if> " + |
| | | "<if test='pagePartyOrganizationVO.name != null and pagePartyOrganizationVO.name.trim() != ""'>" + |
| | | "and m.name=#{pagePartyOrganizationVO.name}"+ |
| | | " </if> " + |
| | | " </where>" + |
| | | "order by m.join_time desc "+ |
| | | "</script>") |
| | | IPage<PartyBuildingMemberVO> pagePartyOrganization(Page page, @Param("pagePartyOrganizationVO") PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" + "m.join_time,\n" + "m.employment_time,\n" + "CASE\n" |
| | | + "WHEN u.id_card IS NULL THEN\n" + "'未注册' ELSE '已注册' \n" + "END STATUS \n" + "FROM\n" + "com_pb_member m\n" |
| | | + "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" + "LEFT JOIN com_pb_org o ON m.org_id = o.id" |
| | | + " where m.community_id = ${pagePartyOrganizationVO.communityId} and m.audit_result='1' " |
| | | + "<if test='pagePartyOrganizationVO.orgName != null and pagePartyOrganizationVO.orgName != ""'>" |
| | | + "and o.name like concat(#{pagePartyOrganizationVO.orgName},'%') " + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.orgId != null'>" + " and o.id = #{pagePartyOrganizationVO.orgId} " |
| | | + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.account != null and pagePartyOrganizationVO.account != ""'>" |
| | | + "and u.phone like concat (#{pagePartyOrganizationVO.account},'%')" + " </if> " |
| | | + "<if test='pagePartyOrganizationVO.name != null and pagePartyOrganizationVO.name != ""'>" |
| | | + "and m.name like concat (#{pagePartyOrganizationVO.name},'%')" + " </if> " + "order by m.create_at desc " |
| | | + "</script>") |
| | | IPage<PartyBuildingMemberVO> pagePartyOrganization(Page page, |
| | | @Param("pagePartyOrganizationVO") PagePartyOrganizationVO pagePartyOrganizationVO); |
| | | |
| | | @Select("select m.id,m.org_id,m.name,m.id_card,m.join_time,m.employment_time,m.audit_result,m.create_at,m.update_at,m.community_id,m.user_id,m.refuse_reason,u.image_url as photoPath from sys_user u join com_pb_member m on u.id_card=m.id_card where u.user_id=#{userId}") |
| | | ComPbMemberDO selectByUserId(Long userId); |
| | | |
| | | @Select("select name from sys_user where user_id=#{createBy}") |
| | | String selectNameByUserId(Long createBy); |
| | | |
| | | @Update("update sys_user u set u.is_partymember=0 where u.phone=#{phone}") |
| | | void updateUserIsPartymember(String phone); |
| | | |
| | | @Select("<script> " + "SELECT\n" + "o.`name` orgName,\n" + "m.org_id,\n" + "m.id_card,\n" + "m.`id`,\n" |
| | | + "u.phone,\n" + "m.`name`,\n" + "m.photo_path,\n" + "TIMESTAMPDIFF(\n" + "YEAR,\n" + "m.employment_time,\n" |
| | | + "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" + "m.join_time,\n" + "m.audit_result, \n" |
| | | + "m.employment_time,\n" + "CASE\n" + "WHEN u.id_card IS NULL THEN\n" + "'未注册' ELSE '已注册' \n" + "END STATUS \n" |
| | | + "FROM\n" + "com_pb_member m\n" + "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" |
| | | + "LEFT JOIN com_pb_org o ON m.org_id = o.id" + " where m.user_id is not null " |
| | | + "<if test='pagePartyBuildingMemberVO.phone != null and pagePartyBuildingMemberVO.phone != ""'>" |
| | | + "and u.phone = #{pagePartyBuildingMemberVO.phone} " + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.name != null and pagePartyBuildingMemberVO.name != ""'>" |
| | | + "and u.name like concat (#{pagePartyBuildingMemberVO.name},'%')" + " </if> " |
| | | + "<if test='pagePartyBuildingMemberVO.auditStatus != null and pagePartyBuildingMemberVO.auditStatus != ""'>" |
| | | + "and m.audit_result = #{pagePartyBuildingMemberVO.auditStatus}" + " </if> " + "order by m.join_time desc " |
| | | + "</script>") |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMemberVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 分页查询待认证党员列表 |
| | | * @param page 分页参数 |
| | | * @param pagePartyBuildingMemberVO 请求参数 |
| | | * @return 待认证党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> pagePartyBuildingMembersVO(Page page, |
| | | @Param("pagePartyBuildingMemberVO") PagePartyBuildingMemberVO pagePartyBuildingMemberVO); |
| | | |
| | | @Select("<script> " |
| | | + "select cpm.name as comName,cpm.id_card,cpm.join_time,cpm.employment_time,ca.`name` as communityName,cpo.name as orgName from com_pb_member as cpm " |
| | | + " left join com_act as ca on ca.community_id = cpm.community_id " |
| | | + " left join com_pb_org as cpo on cpo.id = cpm.org_id " + " LEFT JOIN sys_user u ON cpm.id_card = u.id_card " |
| | | + " where cpm.community_id = ${organizationVO.communityId} and cpm.audit_result = 1 " |
| | | + "<if test='organizationVO.orgName != null'>" + " and cpo.name LIKE CONCAT('%',#{organizationVO.orgName},'%') " |
| | | + " </if> " + "<if test='organizationVO.account != null and organizationVO.account != ""'>" |
| | | + " and u.phone like concat (#{organizationVO.account},'%')" + " </if> " |
| | | + "<if test='organizationVO.name != null and organizationVO.name != ""'>" |
| | | + " and cpm.name like concat (#{organizationVO.name},'%')" + " </if> " + "</script>") |
| | | List<ComPbMemberExcelVO> exportPbMember(@Param("organizationVO") PagePartyOrganizationVO organizationVO); |
| | | |
| | | /** |
| | | * 分页查询党员列表 |
| | | * @param page 分页参数 |
| | | * @param buildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> queryAllByLimit(Page page,@Param("dto") PagePartyOrganizationVO buildingMemberVO); |
| | | |
| | | /** |
| | | * 导出党员列表 |
| | | * @param buildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | List<PartyMemberListExcelVO> exportPartyMemberList(@Param("dto") PagePartyOrganizationVO buildingMemberVO); |
| | | |
| | | /** |
| | | * 根据id查询党员信息 |
| | | * @param id 主键id |
| | | * @param areaCode |
| | | * @return 党员信息 |
| | | */ |
| | | PartyBuildingMemberVO queryById(@Param("id") Long id, @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 分页查询党员数据统计 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员数据统计 |
| | | */ |
| | | IPage<ComDataStatisticsMemberVo> pageDataStatisticsMember(Page page, @Param("dto") PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 查询人口活动统计数据 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 人口活动统计数据 |
| | | */ |
| | | ComDataStatisticsMemberVo getMemberStatistics(@Param("userId") Long userId,@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 查询社区党组织下的统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @return 社区党组织下统计数据 |
| | | */ |
| | | ComDataStatisticsOrgVo getOrgDataStatistics(@Param("communityId") Long communityId,@Param("orgIds") List<Long> orgIds); |
| | | |
| | | /** |
| | | * 查询社区党组织左下统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param startTime 查询开始时间 |
| | | * @param endTime 查询结束时间 |
| | | * @param areaCode |
| | | * @return 社区党组织左下统计数据 |
| | | */ |
| | | ComDataStatisticsOrgVo getOrgDataStatisticsLeftDown(@Param("communityId") Long communityId, @Param("orgIds") List<Long> orgIds |
| | | , @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 分页查询社区党组织下党员 |
| | | * @param page 分页参数 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param areaCode |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> getOrgDataStatisticsMember(@Param("page") Page page, |
| | | @Param("communityId") Long communityId, |
| | | @Param("orgIds") List<Long> orgIds, |
| | | @Param("areaCode") String areaCode); |
| | | |
| | | /** |
| | | * 查询社区党组织下某个时间段统计数据 |
| | | * @param communityId 社区id |
| | | * @param orgIds 党组织id集合 |
| | | * @param startDate 查询开始时间 |
| | | * @param endDate 查询结束时间 |
| | | * @return 社区党组织下某个时间段统计数据 |
| | | */ |
| | | Map<String,Object> getOrgDataStatisticsRightDown(@Param("communityId") Long communityId, |
| | | @Param("orgIds") List<Long> orgIds, |
| | | @Param("startDate") String startDate, |
| | | @Param("endDate") String endDate); |
| | | |
| | | /** |
| | | * 查询党组织表头统计数据 |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 党组织表头统计数据 |
| | | */ |
| | | ComDataStatisticsHeaderOrgVo getHeaderOrgDataStatistics(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 党员数据统计-党员导出数据查询 |
| | | * @param statisticsMemberDto 请求参数 |
| | | * @return 党员导出数据 |
| | | */ |
| | | List<ComDataStatisticsMemberExcelVo> exportDataStatisticsMember(@Param("dto") PageComDataStatisticsMemberDto statisticsMemberDto); |
| | | |
| | | /** |
| | | * 根据报到单位id查询党员列表 |
| | | * @param page 分页参数 |
| | | * @param partyBuildingMemberVO 请求参数 |
| | | * @return 党员列表 |
| | | */ |
| | | IPage<PartyBuildingMemberVO> getPbMemberByApplets(Page page,@Param("dto") PartyBuildingMemberVO partyBuildingMemberVO); |
| | | |
| | | /** |
| | | * 小程序获取报道单位党员列表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | PartyBuildingMemberVO getDetailByApp(Long id); |
| | | |
| | | PartyBuildingMemberVO selectDetail(@Param("phone") String phone,@Param("type")Integer type); |
| | | |
| | | /** |
| | | * 分页查询注册党员列表 |
| | | * @param page |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | IPage<PartyBuildingMemberVO> pageRegisterMember(@Param("page") Page page, @Param("dto") PageMemberForInviteDTO dto); |
| | | |
| | | @Select("SELECT caa.community_id FROM com_act caa WHERE caa.`name` = ( select ca.`name` FROM com_act ca WHERE ca.community_id =#{id})") |
| | | List<Long> selectIds(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 根据区域名称查询社区id |
| | | * @param area |
| | | * @return |
| | | */ |
| | | @Select("select distinct community_id from com_area_town_community where area=#{area}") |
| | | List<Long> selectDistinctCommunityId(@Param("area") String area); |
| | | |
| | | } |