huanghongfa
2021-08-21 2e64c232ab6b51b2cecf1ee96e1e9b709234f326
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
68
69
70
71
72
73
74
75
76
77
78
79
80
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.dtos.community.ExportRealAssetsExcelDTO;
import com.panzhihua.common.model.dtos.community.ExportRealCompanyExcelDTO;
import com.panzhihua.common.model.dtos.community.PageComMngRealAssetsDTO;
import com.panzhihua.common.model.dtos.community.PageComMngRealCompanyDTO;
import com.panzhihua.common.model.vos.community.ComMngRealAssetsExcelVO;
import com.panzhihua.common.model.vos.community.ComMngRealAssetsVO;
import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO;
import com.panzhihua.common.model.vos.community.ComMngRealCompanyVO;
import com.panzhihua.service_community.model.dos.ComMngRealAssetsDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
/**
 * @description: 实有资产
 * @author: Null
 * @date: 2021/3/16 14:28
 */
@Mapper
public interface ComMngRealAssetsDAO extends BaseMapper<ComMngRealAssetsDO> {
 
    @Select("<script> " +
            "SELECT " +
            " t.id, " +
            " t.community_id AS communityId, " +
            " t.`name`, " +
            " t.category, " +
            " t.build_type_id AS buildTypeId, " +
            " t2.`name` AS buildTypeName, " +
            " t.floor_type AS floorType, " +
            " t.num, " +
            " t.square, " +
            " t.province_adcode AS provinceAdcode, " +
            " t.city_adcode AS cityAdcode, " +
            " t.district_adcode AS districtAdcode, " +
            " t.address, " +
            " t.create_at AS createAt  " +
            "FROM " +
            " com_mng_real_assets t " +
            " LEFT JOIN com_mng_struct_build_type t2 ON t.build_type_id = t2.id" +
            " WHERE 1= 1 " +
            "<if test='pageComMngRealAssetsDTO.name != null and pageComMngRealAssetsDTO.name.trim() != &quot;&quot;'>" +
            " and t.name LIKE concat( #{pageComMngRealAssetsDTO.name}, '%' )  " +
            " </if> " +
            "<if test='pageComMngRealAssetsDTO.communityId != null and pageComMngRealAssetsDTO.communityId != 0'>" +
            " and t.community_id = #{pageComMngRealAssetsDTO.communityId} " +
            " </if> " +
            " order by t.create_at desc"+
            "</script>")
    IPage<ComMngRealAssetsVO> pageQueryComMngRealAssets(Page page, @Param(value = "pageComMngRealAssetsDTO") PageComMngRealAssetsDTO pageComMngRealAssetsDTO);
 
    @Select("<script> " +
            " SELECT " +
            " t.`name`, " +
            " case t.category when 1 then '建筑类'  when 2 then '公共设施类' else '/' end category,  " +
            " t2.`name` AS buildTypeName, " +
            " case t.floor_type when 1 then '高层'  when 2 then '中层'  when 3 then '低层' else '/' end floorType,  " +
            " t.num, " +
            " t.square, " +
            " t.address " +
            "FROM " +
            " com_mng_real_assets t " +
            " LEFT JOIN com_mng_struct_build_type t2 ON t.build_type_id = t2.id"+
            "<if test='exportRealAssetsExcelDTO.name != null and exportRealAssetsExcelDTO.name.trim() != &quot;&quot;'>" +
            " and t.name LIKE concat( #{exportRealAssetsExcelDTO.name}, '%' )  " +
            " </if> " +
            "<if test='exportRealAssetsExcelDTO.communityId != null and exportRealAssetsExcelDTO.communityId != 0'>" +
            " and t.community_id = #{exportRealAssetsExcelDTO.communityId} " +
            " </if> " +
            " order by t.create_at desc"+
            "</script>")
    List<ComMngRealAssetsExcelVO> exportRealAssetsExcel(@Param(value = "exportRealAssetsExcelDTO") ExportRealAssetsExcelDTO exportRealAssetsExcelDTO);
}