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.PageActivityMembersVO;
|
import com.panzhihua.common.model.vos.partybuilding.PartyBuildingActivityVO;
|
import com.panzhihua.service_dangjian.model.dos.ComPbActivityMemberDO;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
|
/**
|
* @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() != ""'>" +
|
// " </if> " +
|
// "<if test='nameCn != null and nameCn.trim() != ""'>" +
|
// " </if> " +
|
// "<if test='nameCn != null and nameCn.trim() != ""'>" +
|
// " </if> " +
|
// " </where>" +
|
// "</script>")
|
|
@Select("<script> " +
|
"SELECT\n" +
|
"m.id,\n" +
|
"me.NAME,\n" +
|
"u.phone,\n" +
|
"m.create_at registrationTime \n" +
|
"FROM\n" +
|
"com_pb_activity_member m\n" +
|
"JOIN com_pb_member me ON m.member_id = me.id\n" +
|
"LEFT JOIN sys_user u ON me.id_card = u.id_card \n" +
|
"WHERE\n" +
|
"m.activity_id = #{pageActivityMembersVO.activityId} \n" +
|
"<if test='pageActivityMembersVO.name != null and pageActivityMembersVO.name.trim() != ""'>" +
|
"AND me.`name` = #{pageActivityMembersVO.name} \n" +
|
" </if> " +
|
"<if test='pageActivityMembersVO.phone != null and pageActivityMembersVO.phone.trim() != ""'>" +
|
"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);
|
}
|