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() != ""'>" +
|
" 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() != ""'>" +
|
" 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);
|
}
|