all
huanghongfa
2021-02-20 2ff68802d432b0a0358814e0c1820b95a2a92e03
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
package com.panzhihua.service_user.dao;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.community.ComMngStructHouseVO;
import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
import com.panzhihua.service_user.model.dos.SysUserInputDO;
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: 2021-02-05 17:40
 **/
@Mapper
public interface SysUserInputDAO extends BaseMapper<SysUserInputDO> {
    //    @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("select a.id,a.community_id from com_mng_struct_area a where a.area_name=#{areaName}")
    ComMngStructAreaVO selectByAreaName(String areaName);
    @Select("SELECT \n" +
            "REPLACE(REPLACE(REPLACE(REPLACE(h.house_name,a.address_detail,''),'栋','-'),'单元','-'),'层','-')houseName,\n" +
            "h.house_code\n" +
            "FROM\n" +
            "\tcom_mng_struct_area a \n" +
            "\tjoin com_mng_struct_house h on h.house_name like CONCAT(a.address_detail,'%') and h.type=5\n" +
            "WHERE\n" +
            "\ta.area_name = #{areaName}")
    List<ComMngStructHouseVO> selectHouserByareaName(String areaName);
    @Select("SELECT \n" +
            "p.name,\n" +
            "p.id,\n" +
            "if(p.is_rent=1,'合租','家人')relationship,\n" +
            "p.id_card,\n" +
            "p.phone,\n" +
            "year(curdate())-if(length(p.id_card)=18,substring(p.id_card,7,4),if(length(p.id_card)=15,concat('19',substring(p.id_card,7,2)),null)) as age,\n" +
            "p.create_at\n" +
            "FROM\n" +
            "\tsys_user_input p \n" +
            "WHERE\n" +
            "\tp.door_number = #{doorNumber} \n" +
            "\tAND p.id !=#{userId}")
    List<ComMngFamilyInfoVO> selectListFamily(@Param("doorNumber") String doorNumber, @Param("userId")Long userId);
}