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 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-11-30 10:52
|
**/
|
@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' )) 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} " +
|
"<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> " +
|
|
"order by m.join_time desc "+
|
"</script>")
|
IPage<PartyBuildingMemberVO> pagePartyOrganization(Page page, @Param("pagePartyOrganizationVO") PagePartyOrganizationVO pagePartyOrganizationVO);
|
|
@Select("select m.* 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 m.* from com_pb_member m join sys_user u on m.id_card=u.id_card where m.community_id=#{communityId}")
|
List<ComPbMemberDO> selectListRegister(Long communityId);
|
@Select("select name from sys_user where user_id=#{createBy}")
|
String selectNameByUserId(Long createBy);
|
}
|