101captain
2021-12-30 e9d5fb4b01c383fa5b01bf5e730d4e3da73f266e
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
50
51
52
53
54
55
56
57
58
59
package com.panzhihua.service_dangjian.dao;
 
import java.util.List;
 
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
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.LoginUserInfoVO;
import com.panzhihua.common.model.vos.partybuilding.PageActivityMembersVO;
import com.panzhihua.service_dangjian.model.dos.ComPbActivityMemberDO;
 
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 活动成员
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-12-01 10:04
 **/
@Mapper
public interface ComPbActivityMemberDAO extends BaseMapper<ComPbActivityMemberDO> {
    // @Select("<script> " +
    // " <where>" +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // "<if test='nameCn != null and nameCn.trim() != &quot;&quot;'>" +
    // " </if> " +
    // " </where>" +
    // "</script>")
 
    @Select("<script>  " + "SELECT " + " m.id," + " m.NAME," + " u.phone," + " m.create_at registrationTime" + " FROM "
        + " com_pb_activity_member m " + " LEFT JOIN sys_user u ON m.user_id = u.user_id " + "WHERE "
        + "m.activity_id = #{pageActivityMembersVO.activityId} "
        + "<if test='pageActivityMembersVO.name != null and pageActivityMembersVO.name.trim() != &quot;&quot;'>"
        + "AND m.`name` = #{pageActivityMembersVO.name} " + " </if> "
        + "<if test='pageActivityMembersVO.phone != null and pageActivityMembersVO.phone.trim() != &quot;&quot;'>"
        + "AND u.phone = #{pageActivityMembersVO.phone}" + " </if> " + "</script>")
    IPage<PageActivityMembersVO> pageActivityMembers(Page page,
        @Param("pageActivityMembersVO") PageActivityMembersVO pageActivityMembersVO);
 
    @Select("select a.* from com_pb_activity_member a join com_pb_member m on m.id=a.member_id "
        + "join sys_user u on m.id_card=u.id_card and u.user_id=#{userId} where a.activity_id=#{id}")
    ComPbActivityMemberDO selectByUserIdActivityId(@Param("id") Long id, @Param("userId") Long userId);
 
    @Select("SELECT \n" + "u.user_id\n" + "FROM\n" + "com_pb_activity_member m \n"
        + "join com_pb_member b on m.member_id=b.id\n" + "join sys_user u on b.id_card=u.id_card\n" + "WHERE\n"
        + "m.activity_id =#{id}")
    List<Long> selectAllPartyBuildingActivityMembers(Long id);
 
    @Select("select m.id from sys_user u join com_pb_member m on u.id_card=m.id_card and u.community_id = ${communityId} and u.user_id=#{userId} ")
    Long selectMemberIdByUserId(@Param("userId") Long userId, @Param("communityId") Long communityId);
 
    @Select("select type from sys_user where user_id=#{createBy}")
    LoginUserInfoVO selectUserInfo(Long createBy);
}