manailin
2021-07-27 e209c5e490f56c80c209fbe9c3613069cc0dd70d
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
60
61
62
63
64
65
66
67
package com.panzhihua.service_community.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.community.ComMngStructOtherBuildVO;
import com.panzhihua.service_community.model.dos.ComMngStructOtherBuildDO;
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-14 17:21
 **/
@Mapper
public interface ComMngStructOtherBuildDAO extends BaseMapper<ComMngStructOtherBuildDO> {
 
    //    @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 \n" +
            "b.id,\n" +
            "b.`name`,\n" +
            "t.name buileTypeName,\n" +
            "b.square,\n" +
            "b.address,\n" +
            "b.`state`,\n" +
            "b.layer_type,\n" +
            "b.create_at\n" +
            "FROM\n" +
            "com_mng_struct_other_build b \n" +
            "join com_mng_struct_build_type t on b.type_id=t.id\n" +
            " <where>" +
            "<if test='comMngStructOtherBuildVO.name != null and comMngStructOtherBuildVO.name.trim() != &quot;&quot;'>" +
            " and b.name like concat(#{comMngStructOtherBuildVO.name},'%') "+
            " </if> " +
            "<if test='comMngStructOtherBuildVO.communityId != null'>" +
            " and b.community_id = #{comMngStructOtherBuildVO.communityId} "+
            " </if> " +
            " </where>" +
            " order by b.create_at desc" +
            "</script>")
    IPage<ComMngStructOtherBuildVO> pageOtherBuild(Page page, @Param("comMngStructOtherBuildVO") ComMngStructOtherBuildVO comMngStructOtherBuildVO);
 
    @Select("SELECT\n" +
            "b.type_id \n" +
            "FROM\n" +
            "com_mng_struct_other_build b\n" +
            "WHERE\n" +
            "b.community_id = #{communityId}\n" +
            "GROUP BY\n" +
            "b.type_id")
    List<Long> selectAllBuildTypeIds(Long communityId);
}