huanghongfa
2020-12-29 37f55403e7573d8c15b6b0f957b7cb1baf6be4ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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.PartyBuildingMemberVO;
import com.panzhihua.common.model.vos.partybuilding.PartyCommitteeVO;
import com.panzhihua.service_dangjian.model.dos.ComPbMemberRoleDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 党委
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-12-01 14:36
 **/
@Mapper
public interface ComPbMemberRoleDAO extends BaseMapper<ComPbMemberRoleDO> {
    @Select("<script> " +
            "SELECT\n" +
            "mr.id,\n" +
            "m.NAME,\n" +
            "u.phone,\n" +
            "'党员' politicalOutlook,\n"+
            "m.photo_path,\n" +
            "TIMESTAMPDIFF(\n" +
            "YEAR,\n" +
            "m.employment_time,\n" +
            "DATE_FORMAT( NOW(), '%Y-%m-%d' )) partyAge,\n" +
            "r.role_name ,\n" +
            "mr.role_id \n"+
            "FROM\n" +
            "com_pb_member_role mr\n" +
            "JOIN com_pb_member m ON mr.member_id = m.id\n" +
            "JOIN sys_role r ON mr.role_id = r.role_id \n" +
            "LEFT JOIN sys_user u ON m.id_card = u.id_card\n" +
            "WHERE\n" +
            "mr.community_id = #{partyCommitteeVO.communityId} \n" +
            "<if test='partyCommitteeVO.name != null and partyCommitteeVO.name.trim() != &quot;&quot;'>" +
            "AND m.`name` = #{partyCommitteeVO.name} \n" +
            " </if> " +
            "<if test='partyCommitteeVO.roleId != null and partyCommitteeVO.roleId != 0'>" +
            "AND r.role_id =#{partyCommitteeVO.roleId}" +
            " </if> " +
            "</script>")
    IPage<PartyCommitteeVO> pagePartyOrganization(Page page, @Param("partyCommitteeVO") PartyCommitteeVO partyCommitteeVO);
}