101captain
2022-04-19 00a59b93c16b24e7be77c6f1ce4866c75a2e0431
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
package com.panzhihua.service_community.dao;
 
import java.util.List;
 
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
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.PageComMngRealAssetsDTO;
import com.panzhihua.common.model.vos.community.ComMngRealAssetsExcelVO;
import com.panzhihua.common.model.vos.community.ComMngRealAssetsVO;
import com.panzhihua.service_community.model.dos.ComMngRealAssetsDO;
 
/**
 * @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"
        + " WHERE 1= 1 "
        + "<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);
}