huanghongfa
2020-12-09 4231221cc96b5a7d192422aee8866e4d87bd3d72
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActSignDAO.java
@@ -1,8 +1,12 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.community.ActivitySignVO;
import com.panzhihua.service_community.model.dos.ComActActSignDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -12,4 +16,39 @@
 **/
@Mapper
public interface ComActActSignDAO extends BaseMapper<ComActActSignDO> {
    @Select("<script> " +
            "SELECT\n" +
            "a.id,\n" +
            "u.NAME,\n" +
            "CASE\n" +
            "\n" +
            "WHEN u.is_partymember = 1 THEN\n" +
            "'党员' \n" +
            "WHEN u.is_volunteer = 1 THEN\n" +
            "'支援者' ELSE '居民' \n" +
            "END identity,\n" +
            "u.phone,\n" +
            "a.create_at \n" +
            "FROM\n" +
            "com_act_act_sign a\n" +
            "JOIN sys_user u ON a.user_id = u.user_id \n" +
            "WHERE\n" +
            "a.activity_id = #{activityId} \n" +
            "<if test='phone != null and phone.trim() != &quot;&quot;'>" +
            "AND u.phone = #{phone} \n" +
            " </if> " +
            "<if test='name != null and name.trim() != &quot;&quot;'>" +
            "AND u.`name` = #{name} \n" +
            " </if> " +
            "<if test='identity != null and identity.trim() != &quot;&quot; and identity=党员'>" +
            "AND is_partymember = 1 \n" +
            " </if> " +
            "<if test='identity != null and identity.trim() != &quot;&quot; and identity=志愿者'>" +
            "AND is_partymember = 2 and is_volunteer=1  \n" +
            " </if> " +
            "<if test='identity != null and identity.trim() != &quot;&quot; and identity=居民'>" +
            "AND is_partymember = 2 and is_volunteer=2  \n" +
            " </if> " +
            "</script>")
    List<ActivitySignVO> listActivitySign(ActivitySignVO activitySignVO);
}