From 4ee9e6833f738e22390c4e875fe140c2b96cfcc2 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 29 十一月 2024 04:03:37 +0800
Subject: [PATCH] 项目库分页查询
---
common/src/main/java/com/ycl/common/utils/DateUtils.java | 35 +
business/src/main/resources/mapper/ProjectInfoMapper.xml | 166 +++++---
business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java | 2
common/src/main/java/com/ycl/common/utils/CopyUtils.java | 48 ++
business/src/main/java/com/ycl/domain/excel/ProjectExcelTemplate.java | 655 ++++++++++++++++++++++++++++++++++++
business/src/main/java/com/ycl/domain/vo/ProjectVO.java | 15
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java | 61 ++-
business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java | 26 +
business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java | 34 +
9 files changed, 949 insertions(+), 93 deletions(-)
diff --git a/business/src/main/java/com/ycl/domain/excel/ProjectExcelTemplate.java b/business/src/main/java/com/ycl/domain/excel/ProjectExcelTemplate.java
new file mode 100644
index 0000000..58228b0
--- /dev/null
+++ b/business/src/main/java/com/ycl/domain/excel/ProjectExcelTemplate.java
@@ -0,0 +1,655 @@
+package com.ycl.domain.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 瀵煎嚭妯℃澘绫�
+ *
+ * @Author: ljx
+ * @CreateTime: 2024-10-18 10:19
+ */
+
+@Data
+public class ProjectExcelTemplate {
+ private static final long serialVersionUID = 1L;
+
+ /* 椤圭洰绠$悊鍩虹淇℃伅琛� */
+
+ /**
+ * 椤圭洰鍚嶇О
+ */
+ @ExcelProperty(value = "椤圭洰鍚嶇О")
+ private String projectName;
+
+ /**
+ * 椤圭洰浠g爜
+ */
+ @ExcelProperty(value = "椤圭洰浠g爜")
+ private String projectCode;
+
+ /**
+ * 椤圭洰绫诲瀷
+ */
+ @ExcelProperty(value = "椤圭洰绫诲瀷")
+ private String projectType;
+
+ /**
+ * 椤圭洰鐘舵��
+ */
+ @ExcelProperty(value = "椤圭洰鐘舵��")
+ private String projectStatus;
+
+ /**
+ * 璧勯噾绫诲瀷
+ */
+ @ExcelProperty(value = "璧勯噾绫诲瀷")
+ private String fundType;
+
+ /**
+ * 鎶曡祫绫诲埆
+ */
+ @ExcelProperty(value = "鎶曡祫绫诲埆")
+ private String investType;
+
+ /**
+ * 閲嶇偣鍒嗙被
+ */
+ @ExcelProperty(value = "閲嶇偣鍒嗙被")
+ private String importanceType;
+
+ /**
+ * 椤圭洰闃舵
+ */
+ @ExcelProperty(value = "椤圭洰闃舵")
+ private String projectPhase;
+
+ /**
+ * 鏍囩
+ */
+ @ExcelProperty(value = "鏍囩")
+ private String tag;
+
+ /**
+ * 涓荤閮ㄩ棬
+ */
+ @ExcelProperty(value = "涓荤閮ㄩ棬")
+ private String competentDepartment;
+
+ /**
+ * 椤圭洰褰掑睘鍦�
+ */
+ @ExcelProperty(value = "椤圭洰褰掑睘鍦�")
+ private String projectLocation;
+
+ /**
+ * 缁忓害
+ */
+ @ExcelProperty(value = "缁忓害")
+ private String longitude;
+
+ /**
+ * 绾害
+ */
+ @ExcelProperty(value = "绾害")
+ private String latitude;
+
+ /**
+ * 绠$悊褰掑彛
+ */
+ @ExcelProperty(value = "绠$悊褰掑彛")
+ private String managementCentralization;
+
+ /**
+ * 椤圭洰鐢虫姤闃舵
+ */
+ @ExcelProperty(value = "椤圭洰鐢虫姤闃舵")
+ private String projectApplicationPhase;
+
+ /**
+ * 椤圭洰瀹℃壒绫诲瀷
+ */
+ @ExcelProperty(value = "椤圭洰瀹℃壒绫诲瀷")
+ private String projectApprovalType;
+
+ /**
+ * 鎶曡祫鐩綍
+ */
+ @ExcelProperty(value = "鎶曡祫鐩綍")
+ private String investmentCatalogue;
+
+ /**
+ * 瀹℃壒璁″垝涔�
+ */
+ @ExcelProperty(value = "瀹℃壒璁″垝涔︼紙闄勪欢鍚嶏級")
+ private String approvalPlan;
+
+ /**
+ * 鏄惁绔嬮」
+ */
+ @ExcelProperty(value = "鏄惁绔嬮」")
+ private String isSetProject;
+
+ /**
+ * 鎴愮珛鏃堕棿
+ */
+ @ExcelProperty(value = "鎴愮珛鏃堕棿")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date setTime;
+
+ /**
+ * 璧嬬爜鐘舵��
+ */
+ @ExcelProperty(value = "璧嬬爜鐘舵��")
+ private String assignmentStatus;
+
+ /**
+ * 琛屾斂鍖哄垝
+ */
+ @ExcelProperty(value = "琛屾斂鍖哄垝")
+ private String area;
+
+ /**
+ * 涓爣鏃堕棿
+ */
+ @ExcelProperty(value = "涓爣鏃堕棿")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date winTime;
+
+ /**
+ * 涓爣鍗曚綅
+ */
+ @ExcelProperty(value = "涓爣鍗曚綅")
+ private String winUnit;
+
+ /**
+ * 涓爣閲戦
+ */
+ @ExcelProperty(value = "涓爣閲戦")
+ private String winAmount;
+
+ /**
+ * 璇︾粏鍦板潃
+ */
+ @ExcelProperty(value = "璇︾粏鍦板潃")
+ private String address;
+
+ /**
+ * 寤鸿鍐呭
+ */
+ @ExcelProperty(value = "寤鸿鍐呭")
+ private String content;
+
+ /**
+ * 鑱旂郴鏂瑰紡
+ */
+ @ExcelProperty(value = "鑱旂郴鏂瑰紡")
+ private String contact;
+
+ /**
+ * 椤圭洰涓氫富鍗曚綅
+ */
+ @ExcelProperty(value = "椤圭洰涓氫富鍗曚綅")
+ private String projectOwnerUnit;
+
+ /**
+ * 璁″垝寮�宸ユ椂闂�
+ */
+ @ExcelProperty(value = "璁″垝寮�宸ユ椂闂�")
+ private Date planStartTime;
+
+ /**
+ * 璁″垝绔e伐鏃堕棿
+ */
+ @ExcelProperty(value = "璁″垝绔e伐鏃堕棿")
+ private Date planCompleteTime;
+
+ /**
+ * 椤圭洰鑱旂郴浜�
+ */
+ @ExcelProperty(value = "椤圭洰鑱旂郴浜�")
+ private String projectContactPerson;
+
+ /**
+ * 鏈勾璁″垝鎶曡祫
+ */
+ @ExcelProperty(value = "鏈勾璁″垝鎶曡祫")
+ private BigDecimal yearInvestAmount;
+
+
+ /* 鎶曡祫椤圭洰鍩虹淇℃伅琛� */
+
+ /**
+ * 寤鸿鍦扮偣鏄惁璺ㄥ煙
+ */
+ @ExcelProperty(value = "寤鸿鍦扮偣鏄惁璺ㄥ煙")
+ private String beCrossRegion;
+
+ /**
+ * 椤圭洰寤鸿鍦扮偣
+ */
+ @ExcelProperty(value = "寤鸿鍦扮偣")
+ private String constructionLocation;
+
+
+ /**
+ * 寤鸿璇︾粏鍦板潃
+ */
+ @ExcelProperty(value = "寤鸿璇︾粏鍦板潃")
+ private String detailedAddress;
+
+ /**
+ * 鏄惁鏄ˉ鐮侀」鐩�
+ */
+ @ExcelProperty(value = "鏄惁鏄ˉ鐮侀」鐩�")
+ private String beCompensationProject;
+
+ /**
+ * 琛ョ爜鍘熷洜
+ */
+ @ExcelProperty(value = "琛ョ爜鍘熷洜")
+ private String compensationReason;
+
+ /**
+ * 璁″垝寮�宸ユ椂闂�
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ExcelProperty(value = "璁″垝寮�宸ユ椂闂�")
+ private Date plannedStartDate;
+
+ /**
+ * 鎷熷缓鎴愭椂闂�
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @ExcelProperty(value = "鎷熷缓鎴愭椂闂�")
+ private Date expectedCompletionDate;
+
+ /**
+ * 鍥芥爣琛屼笟鍒嗙被
+ */
+ @ExcelProperty(value = "鍥芥爣琛屼笟鍒嗙被")
+ private String nationalIndustryClassification;
+
+ /**
+ * 鎵�灞炶涓氬垎绫�
+ */
+ @ExcelProperty(value = "鎵�灞炶涓氬垎绫�")
+ private String industryClassification;
+
+ /**
+ * 椤圭洰寤鸿鎬ц川
+ */
+ @ExcelProperty(value = "椤圭洰寤鸿鎬ц川")
+ private String projectNature;
+
+ /**
+ * 椤圭洰灞炴��
+ */
+ @ExcelProperty(value = "椤圭洰灞炴��")
+ private String projectAttribute;
+
+ /**
+ * 鏄惁浣跨敤鍦熷湴
+ */
+ @ExcelProperty(value = "鏄惁浣跨敤鍦熷湴")
+ private String useEarth;
+
+ /**
+ * 涓昏寤鸿鍐呭鍙婅妯�
+ */
+ @ExcelProperty(value = "涓昏寤鸿鍐呭鍙婅妯�")
+ private String contentScale;
+
+ /**
+ * 寤虹骞冲彴浠g爜
+ */
+ @ExcelProperty(value = "寤虹骞冲彴浠g爜")
+ private String code;
+
+
+ /* 椤圭洰鎶曡祫鍙婅祫閲戞潵婧� */
+
+ /**
+ * 椤圭洰鎬绘姇璧勯
+ */
+ @ExcelProperty(value = "椤圭洰鎬绘姇璧勯")
+ private String totalInvestment;
+
+ /**
+ * 椤圭洰鏈噾
+ */
+ @ExcelProperty(value = "椤圭洰鏈噾")
+ private String principal;
+
+ /**
+ * 鏀垮簻鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "鏀垮簻鎶曡祫鎬婚")
+ private String governmentInvestmentTotal;
+
+ /**
+ * 涓ぎ鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "涓ぎ鎶曡祫鎬婚")
+ private String centralInvestmentTotal;
+
+ /**
+ * 涓ぎ棰勭畻鎶曡祫
+ */
+ @ExcelProperty(value = "涓ぎ棰勭畻鎶曡祫")
+ private String centralBudgetInvestment;
+
+ /**
+ * 涓ぎ璐㈡斂
+ */
+ @ExcelProperty(value = "涓ぎ璐㈡斂")
+ private String centralFiscalInvestment;
+
+ /**
+ * 涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�
+ */
+ @ExcelProperty(value = "涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�")
+ private String centralSpecialBondInvestment;
+
+ /**
+ * 涓ぎ涓撻」寤鸿鍩洪噾
+ */
+ @ExcelProperty(value = "涓ぎ涓撻」寤鸿鍩洪噾")
+ private String centralSpecialFundInvestment;
+
+ /**
+ * 鐪佺骇鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "鐪佺骇鎶曡祫鎬婚")
+ private String provincialInvestmentTotal;
+
+ /**
+ * 鐪侀绠楀唴鎶曡祫
+ */
+ @ExcelProperty(value = "鐪侀绠楀唴鎶曡祫")
+ private String provincialBudgetInvestment;
+
+ /**
+ * 鐪佽储鏀挎�у缓璁炬姇璧�
+ */
+ @ExcelProperty(value = "鐪佽储鏀挎�у缓璁炬姇璧�")
+ private String provincialFiscalInvestment;
+
+ /**
+ * 鐪佷笓椤瑰缓璁捐祫閲�
+ */
+ @ExcelProperty(value = "鐪佷笓椤瑰缓璁捐祫閲�")
+ private String provincialSpecialFundInvestment;
+
+ /**
+ * 甯傦紙宸烇級鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "甯傦紙宸烇級鎶曡祫鎬婚")
+ private String cityInvestmentTotal;
+
+ /**
+ * 甯傦紙宸烇級棰勭畻鍐呮姇璧�
+ */
+ @ExcelProperty(value = "甯傦紙宸烇級棰勭畻鍐呮姇璧�")
+ private String cityBudgetInvestment;
+
+ /**
+ * 甯傦紙宸烇級璐㈡斂鎬ф姇璧�
+ */
+ @ExcelProperty(value = "甯傦紙宸烇級璐㈡斂鎬ф姇璧�")
+ private String cityFiscalInvestment;
+
+ /**
+ * 甯傦紙宸烇級涓撻」璧勯噾
+ */
+ @ExcelProperty(value = "甯傦紙宸烇級涓撻」璧勯噾")
+ private String citySpecialFundInvestment;
+
+ /**
+ * 鍘匡紙甯傘�佸尯锛夋姇璧勬�婚
+ */
+ @ExcelProperty(value = "鍘匡紙甯傘�佸尯锛夋姇璧勬�婚")
+ private String countyInvestmentTotal;
+
+ /**
+ * 鍘匡紙甯傘�佸尯锛夐绠楀唴鎶曡祫
+ */
+ @ExcelProperty(value = "鍘匡紙甯傘�佸尯锛夐绠楀唴鎶曡祫")
+ private String countyBudgetInvestment;
+
+ /**
+ * 鍘匡紙甯傘�佸尯锛夎储鏀挎�у缓璁捐祫閲�
+ */
+ @ExcelProperty(value = "鍘匡紙甯傘�佸尯锛夎储鏀挎�у缓璁捐祫閲�")
+ private String countyFiscalInvestment;
+
+ /**
+ * 鍘匡紙甯傘�佸尯锛変笓椤硅祫閲�
+ */
+ @ExcelProperty(value = "鍘匡紙甯傘�佸尯锛変笓椤硅祫閲�")
+ private String countySpecialFundInvestment;
+
+ /**
+ * 鍥藉唴璐锋鎬婚
+ */
+ @ExcelProperty(value = "鍥藉唴璐锋鎬婚")
+ private String domesticLoanTotal;
+
+ /**
+ * 閾惰璐锋
+ */
+ @ExcelProperty(value = "閾惰璐锋")
+ private String bankLoan;
+
+ /**
+ * 澶栧晢鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "澶栧晢鎶曡祫鎬婚")
+ private String foreignInvestmentTotal;
+
+ /**
+ * 浼佷笟鑷鎬婚
+ */
+ @ExcelProperty(value = "浼佷笟鑷鎬婚")
+ private String enterpriseSelfRaisedTotal;
+
+ /**
+ * 鍏朵粬鎶曡祫鎬婚
+ */
+ @ExcelProperty(value = "鍏朵粬鎶曡祫鎬婚")
+ private String otherInvestmentTotal;
+
+
+ /* 椤圭洰锛堟硶浜猴級鍗曚綅鐧昏淇℃伅琛� */
+
+// /**
+// * 椤圭洰鎬绘姇璧勯(鏍规嵁鍓嶉潰鐨勬暟鎹~鍏�)
+// */
+// private BigDecimal totalInvestment;
+
+ /**
+ * 椤圭洰鍗曚綅
+ */
+ @ExcelProperty(value = "椤圭洰鍗曚綅")
+ private String projectUnit;
+
+ /**
+ * 椤圭洰鍗曚綅绫诲瀷
+ */
+ @ExcelProperty(value = "椤圭洰鍗曚綅绫诲瀷")
+ private String projectUnitType;
+
+ /**
+ * 鐧昏娉ㄥ唽绫诲瀷
+ */
+ @ExcelProperty(value = "鐧昏娉ㄥ唽绫诲瀷")
+ private String registrationType;
+
+ /**
+ * 鎺ц偂鎯呭喌
+ */
+ @ExcelProperty(value = "鎺ц偂鎯呭喌")
+ private String holdingSituation;
+
+ /**
+ * 璇佺収绫诲瀷
+ */
+ @ExcelProperty(value = "璇佺収绫诲瀷")
+ private String certificateType;
+
+ /**
+ * 璇佺収鍙风爜
+ */
+ @ExcelProperty(value = "璇佺収鍙风爜")
+ private String certificateNumber;
+
+ /**
+ * 娉ㄥ唽鍦板潃
+ */
+ @ExcelProperty(value = "娉ㄥ唽鍦板潃")
+ private String registeredAddress;
+
+ /**
+ * 娉ㄥ唽璧勯噾
+ */
+ @ExcelProperty(value = "娉ㄥ唽璧勯噾")
+ private BigDecimal registeredCapital;
+
+ /**
+ * 娉曚汉浠h〃
+ */
+ @ExcelProperty(value = "娉曚汉浠h〃")
+ private String legal_representative;
+
+ /**
+ * 鍥哄畾鐢佃瘽
+ */
+ @ExcelProperty(value = "鍥哄畾鐢佃瘽")
+ private String fixedPhone;
+
+ /**
+ * 娉曚汉韬唤璇�
+ */
+ @ExcelProperty(value = "娉曚汉韬唤璇�")
+ private String legalPersonIdcard;
+
+// /**
+// * 椤圭洰鑱旂郴浜猴紙鏍规嵁鍓嶉潰鐨勬暟鎹~鍏咃級
+// */
+// private String projectContactPerson;
+
+ /**
+ * 绉诲姩鐢佃瘽
+ */
+ @ExcelProperty(value = "绉诲姩鐢佃瘽")
+ private String phone;
+
+ /**
+ * 鑱旂郴浜鸿韩浠借瘉
+ */
+ @ExcelProperty(value = "鑱旂郴浜鸿韩浠借瘉")
+ private String contactIdcard;
+
+ /**
+ * 寰俊鍙�
+ */
+ @ExcelProperty(value = "寰俊鍙�")
+ private String wechat;
+
+ /**
+ * 鑱旂郴浜洪�氳鍦板潃
+ */
+ @ExcelProperty(value = "鑱旂郴浜洪�氳鍦板潃")
+ private String contactAddress;
+
+ /**
+ * 閭斂缂栫爜
+ */
+ @ExcelProperty(value = "閭斂缂栫爜")
+ private String postCode;
+
+ /**
+ * 鐢靛瓙閭
+ */
+ @ExcelProperty(value = "鐢靛瓙閭")
+ private String email;
+
+ /* 鎶曡祫椤圭洰浜т笟鏀跨瓥绗﹀悎鎯呭喌琛� */
+
+
+ /**
+ * 绗﹀悎浜т笟鏀跨瓥闄勪欢
+ */
+ @ExcelProperty(value = "绗﹀悎浜т笟鏀跨瓥(闄勪欢鍚�)")
+ private String policyComplianceAttachment;
+
+ /**
+ * 鏄惁灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩�
+ */
+ @ExcelProperty(value = "灞炰簬銆婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬩笅鐨勯」鐩�")
+ private String belongsToIndustryAdjustmentDirectory;
+
+ /**
+ * 鏄惁灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩�
+ */
+ @ExcelProperty(value = "灞炰簬鏈垪鍏ャ�婁骇涓氱粨鏋勮皟鏁存寚瀵肩洰褰曘�嬬殑鍏佽绫婚」鐩�")
+ private String belongsToAllowedProjects;
+
+ /**
+ * 鏄惁灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰
+ */
+ @ExcelProperty(value = "灞炰簬銆婅タ閮ㄥ湴鍖洪紦鍔辩被浜т笟鐩綍銆嬬殑椤圭洰")
+ private String belongsToWesternEncouragedDirectory;
+
+ /**
+ * 鏄惁涓嶅睘浜庝骇涓氭斂绛栫姝㈡姇璧勫缓璁炬垨瀹炶鏍稿噯銆佸鎵圭鐞嗙殑椤圭洰
+ */
+ @ExcelProperty(value = "涓嶅睘浜庝骇涓氭斂绛栫姝㈡姇璧勫缓璁炬垨瀹炶鏍稿噯銆佸鎵圭鐞嗙殑椤圭洰")
+ private String notBannedOrControlledProject;
+
+ /**
+ * 濉姤淇℃伅鏄惁鐪熷疄
+ */
+ @ExcelProperty(value = "濉姤淇℃伅鏄惁鐪熷疄")
+ private String informationIsTrue;
+
+ /**
+ * 涓撻」瑙勫垝澶嶅悎鎯呭喌
+ */
+ @ExcelProperty(value = "涓撻」瑙勫垝澶嶅悎鎯呭喌")
+ private String specialPlanningCompliance;
+
+ /**
+ * 椤圭洰鑳借�楁儏鍐�
+ */
+ @ExcelProperty(value = "椤圭洰鑳借�楁儏鍐�")
+ private String energyConsumption;
+
+ /**
+ * 椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級
+ */
+ @ExcelProperty(value = "椤圭洰骞寸患鍚堣兘婧愭秷璐归噺锛堟爣鍑嗙叅褰撻噺鍊硷級")
+ private BigDecimal annualEnergyConsumption;
+
+ /**
+ * 椤圭洰骞寸數鍔涙秷鑰楅噺锛堟爣鍑嗙叅褰撻噺鍊硷級
+ */
+ @ExcelProperty(value = "椤圭洰骞寸數鍔涙秷鑰楅噺锛堟爣鍑嗙叅褰撻噺鍊硷級")
+ private BigDecimal annualElectricityConsumption;
+
+
+ /* 鐩稿叧鏂囦功 */
+ @ExcelProperty(value = "鐩稿叧鏂囦功锛堥檮浠跺悕锛�")
+ private String documents;
+
+
+}
diff --git a/business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java b/business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java
index 071663f..334a8db 100644
--- a/business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java
+++ b/business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java
@@ -1,8 +1,12 @@
package com.ycl.domain.query;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.system.domain.base.AbsQuery;
import io.swagger.annotations.ApiModel;
import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
/**
* 椤圭洰绠$悊鍩虹淇℃伅琛ㄦ煡璇�
@@ -13,5 +17,35 @@
@Data
@ApiModel(value = "ProjectInfo鏌ヨ鍙傛暟", description = "椤圭洰绠$悊鍩虹淇℃伅琛ㄦ煡璇㈠弬鏁�")
public class ProjectInfoQuery extends AbsQuery {
+ //椤圭洰绫诲埆
+ private String projectCategory;
+ //椤圭洰鍚嶇О
+ private String projectName;
+ //椤圭洰浠g爜
+ private String projectCode;
+ //椤圭洰绫诲瀷
+ private String projectType;
+ //閲嶇偣鍒嗙被
+ private String importanceType;
+ //椤圭洰鏍囩
+ private String tag;
+ //椤圭洰鐘舵��
+ private String projectStatus;
+ //椤圭洰鐮�
+ private String projectColorCode;
+ //鍏宠仈鐘舵��
+ private String assignmentStatus;
+ //璧勯噾绫诲瀷
+ private String fundType;
+ //椤圭洰闃舵
+ private String projectPhase;
+ //鎶曡祫绫诲埆
+ private String investType;
+ //琛屾斂鍖哄垝
+ private String area;
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date projectStartTime;
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date projectEndTime;
}
diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java
index ee49ea6..ee82745 100644
--- a/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java
+++ b/business/src/main/java/com/ycl/domain/vo/ProjectInfoVO.java
@@ -67,7 +67,7 @@
/** 涓荤閮ㄩ棬(瀵瑰簲瀹℃壒閮ㄩ棬id) */
@ApiModelProperty("涓荤閮ㄩ棬(瀵瑰簲瀹℃壒閮ㄩ棬id)")
private List<Long> competentDepartmentList;
-
+ private String competentDepartment;
/** 琛屾斂鍖哄煙 */
@ApiModelProperty("琛屾斂鍖哄煙")
private String area;
@@ -75,7 +75,7 @@
/** 绠$悊褰掑彛 (0鍩烘湰寤鸿(鍙戞敼), 1鏇存柊鏀归��(缁忎俊), 2鍗曠函璐疆(鍙戞敼), 3淇℃伅鍖�(鍙戞敼), 4鍏朵粬鎶曡祫) */
@ApiModelProperty("绠$悊褰掑彛 (0鍩烘湰寤鸿(鍙戞敼), 1鏇存柊鏀归��(缁忎俊), 2鍗曠函璐疆(鍙戞敼), 3淇℃伅鍖�(鍙戞敼), 4鍏朵粬鎶曡祫)")
private List<String> managementCentralizationList;
-
+ private String managementCentralization;
/** 椤圭洰瀹℃壒绫诲瀷 */
@ApiModelProperty("椤圭洰瀹℃壒绫诲瀷")
private String projectApprovalType;
@@ -160,6 +160,11 @@
@ApiModelProperty("鏂囦欢")
private List<File> fileList;
+ private ProjectInvestmentInfoVO projectInvestmentInfo;
+ private ProjectInvestmentFundingVO projectInvestmentFunding;
+ private ProjectUnitRegistrationInfoVO projectUnitRegistrationInfo;
+ private ProjectInvestmentPolicyComplianceVO projectInvestmentPolicyCompliance;
+
public static ProjectInfoVO getVoByEntity(@NonNull ProjectInfo entity, ProjectInfoVO vo) {
if(vo == null) {
vo = new ProjectInfoVO();
@@ -180,5 +185,20 @@
}
return vo;
}
-
+ //杞崲瀛楃涓查泦鍚堝瓧娈�
+ public static void transform(@NonNull ProjectInfoVO vo) {
+ //涓荤閮ㄩ棬杞垚list
+ String competentDepartment = vo.getCompetentDepartment();
+ if(!StringUtils.isBlank(competentDepartment)){
+ List<Long> list = Arrays.stream(competentDepartment.split(","))
+ .map(Long::parseLong)
+ .collect(Collectors.toList());
+ vo.setCompetentDepartmentList(list);
+ }
+ //绠$悊褰掑彛杞崲
+ String managementCentralization = vo.getManagementCentralization();
+ if(!StringUtils.isBlank(managementCentralization)){
+ vo.setManagementCentralizationList(Arrays.asList(managementCentralization.split(",")));
+ }
+ }
}
diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectVO.java
new file mode 100644
index 0000000..82e1bb6
--- /dev/null
+++ b/business/src/main/java/com/ycl/domain/vo/ProjectVO.java
@@ -0,0 +1,15 @@
+package com.ycl.domain.vo;
+
+import com.ycl.domain.excel.ProjectExcelTemplate;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ProjectVO extends ProjectExcelTemplate {
+ private Long id;
+ /** 鐘舵�佺爜 */
+ private String projectColorCode;
+ private List<Long> competentDepartmentList;
+ private List<String> managementCentralizationList;
+}
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
index 26368cf..39d69d4 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -5,6 +5,8 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.common.base.Result;
import com.ycl.common.enums.business.FileTypeEnum;
+import com.ycl.common.utils.CopyUtils;
+import com.ycl.common.utils.DateUtils;
import com.ycl.common.utils.SecurityUtils;
import com.ycl.domain.entity.File;
import com.ycl.domain.entity.ProjectInfo;
@@ -42,6 +44,7 @@
private final ProjectInfoMapper projectInfoMapper;
private final FileService fileService;
private final FileMapper fileMapper;
+
/**
* 娣诲姞
*
@@ -59,7 +62,7 @@
baseMapper.insert(entity);
//娣诲姞鏂囦欢
List<File> fileList = form.getFileList();
- fileList.forEach(item->{
+ fileList.forEach(item -> {
item.setBusId(entity.getId());
item.setType(FileTypeEnum.PROJECT_INFO);
});
@@ -79,20 +82,21 @@
ProjectInfo entity = baseMapper.selectById(form.getId());
// 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
- ProjectInfoForm.getEntityByForm(form,entity);
+ ProjectInfoForm.getEntityByForm(form, entity);
Long userId = SecurityUtils.getUserId();
entity.setUpdateBy(userId);
//鏇存柊椤圭洰淇℃伅
baseMapper.updateById(entity);
List<File> fileList = form.getFileList();
- fileList.forEach(item->{
+ fileList.forEach(item -> {
+ item.setId(null);
item.setBusId(entity.getId());
item.setType(FileTypeEnum.PROJECT_INFO);
});
//鍒犻櫎鍘熸湁鏂囦欢
QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
- fileQueryWrapper.eq("type",FileTypeEnum.PROJECT_INFO.getType());
- fileQueryWrapper.eq("bus_id",entity.getId());
+ fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType());
+ fileQueryWrapper.eq("bus_id", entity.getId());
fileMapper.delete(fileQueryWrapper);
//鏇挎崲鎴愮幇鏈�
fileService.saveBatch(fileList);
@@ -133,17 +137,33 @@
*/
@Override
public Result page(ProjectInfoQuery query) {
- IPage<ProjectInfo> page = PageUtil.getPage(query, ProjectInfo.class);
+ if (query.getProjectStartTime() != null) {
+ query.setProjectStartTime(DateUtils.getDayStart(query.getProjectStartTime()));
+ }
+ if (query.getProjectEndTime() != null) {
+ query.setProjectEndTime(DateUtils.getDayEnd(query.getProjectEndTime()));
+ }
+ IPage<ProjectInfoVO> page = PageUtil.getPage(query, ProjectInfoVO.class);
baseMapper.getPage(page, query);
- List<ProjectInfo> records = page.getRecords();
- List<ProjectInfoVO> list = records.stream()
- .map(entity -> {
- ProjectInfoVO vo = ProjectInfoVO.getVoByEntity(entity, null);
+ List<ProjectInfoVO> records = page.getRecords();
+ List<ProjectVO> list = new ArrayList<>();
+ records.forEach(vo -> {
+ ProjectInfoVO.transform(vo);
vo.setProjectColorCode("green");
- return vo;
- })
- .collect(Collectors.toList());
+ ProjectVO projectVO = new ProjectVO();
+ copyToProjectVO(vo,projectVO);
+ list.add(projectVO);
+ });
return Result.ok().data(list).total(page.getTotal());
+ }
+
+ private void copyToProjectVO(ProjectInfoVO vo,ProjectVO projectVO) {
+ //蹇界暐null鍊肩殑澶嶅埗
+ CopyUtils.copyNoNullProperties(vo, projectVO);
+ if(vo.getProjectInvestmentFunding()!=null) CopyUtils.copyNoNullProperties(vo.getProjectInvestmentFunding(),projectVO);
+ if(vo.getProjectInvestmentInfo()!=null) CopyUtils.copyNoNullProperties(vo.getProjectInvestmentInfo(),projectVO);
+ if(vo.getProjectUnitRegistrationInfo()!=null) CopyUtils.copyNoNullProperties(vo.getProjectUnitRegistrationInfo(),projectVO);
+ if(vo.getProjectInvestmentPolicyCompliance()!=null) CopyUtils.copyNoNullProperties(vo.getProjectInvestmentPolicyCompliance(),projectVO);
}
/**
@@ -158,8 +178,8 @@
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
ProjectInfoVO vo = ProjectInfoVO.getVoByEntity(entity, null);
QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
- fileQueryWrapper.eq("type",FileTypeEnum.PROJECT_INFO.getType());
- fileQueryWrapper.eq("bus_id",vo.getId());
+ fileQueryWrapper.eq("type", FileTypeEnum.PROJECT_INFO.getType());
+ fileQueryWrapper.eq("bus_id", vo.getId());
List<File> files = fileMapper.selectList(fileQueryWrapper);
vo.setFileList(files);
return Result.ok().data(vo);
@@ -216,8 +236,8 @@
public Result docDetail(Integer id) {
DocumentInfoForm documentInfoForm = new DocumentInfoForm();
QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
- fileQueryWrapper.eq("type",FileTypeEnum.DOCUMENT_INFO.getType());
- fileQueryWrapper.eq("bus_id",id);
+ fileQueryWrapper.eq("type", FileTypeEnum.DOCUMENT_INFO.getType());
+ fileQueryWrapper.eq("bus_id", id);
List<File> files = fileMapper.selectList(fileQueryWrapper);
documentInfoForm.setFileList(files);
return Result.ok().data(documentInfoForm);
@@ -226,14 +246,15 @@
@Override
public Result addDoc(DocumentInfoForm form) {
List<File> fileList = form.getFileList();
- fileList.forEach(item->{
+ fileList.forEach(item -> {
+ item.setId(null);
item.setBusId(form.getProjectId());
item.setType(FileTypeEnum.DOCUMENT_INFO);
});
//鍒犻櫎鍘熸湁鏂囦欢
QueryWrapper<File> fileQueryWrapper = new QueryWrapper<>();
- fileQueryWrapper.eq("type",FileTypeEnum.DOCUMENT_INFO.getType());
- fileQueryWrapper.eq("bus_id",form.getProjectId());
+ fileQueryWrapper.eq("type", FileTypeEnum.DOCUMENT_INFO.getType());
+ fileQueryWrapper.eq("bus_id", form.getProjectId());
fileMapper.delete(fileQueryWrapper);
//鏇挎崲鎴愮幇鏈�
fileService.saveBatch(fileList);
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
index ddf8c91..0d7ef45 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentPolicyComplianceServiceImpl.java
@@ -56,6 +56,7 @@
//娣诲姞鏂囦欢
List<File> fileList = form.getFileList();
fileList.forEach(item->{
+ item.setId(null);
item.setBusId(entity.getId());
item.setType(FileTypeEnum.INVEST_POLICY);
});
@@ -80,6 +81,7 @@
baseMapper.updateById(entity);
List<File> fileList = form.getFileList();
fileList.forEach(item->{
+ item.setId(null);
item.setBusId(entity.getId());
item.setType(FileTypeEnum.INVEST_POLICY);
});
diff --git a/business/src/main/resources/mapper/ProjectInfoMapper.xml b/business/src/main/resources/mapper/ProjectInfoMapper.xml
index 4beeb90..251f0c0 100644
--- a/business/src/main/resources/mapper/ProjectInfoMapper.xml
+++ b/business/src/main/resources/mapper/ProjectInfoMapper.xml
@@ -3,44 +3,15 @@
<mapper namespace="com.ycl.mapper.ProjectInfoMapper">
<!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
- <resultMap id="BaseResultMap" type="com.ycl.domain.entity.ProjectInfo">
- <id column="id" property="id"/>
- <result column="project_name" property="projectName" />
- <result column="project_code" property="projectCode" />
- <result column="content" property="content" />
- <result column="project_type" property="projectType" />
- <result column="project_status" property="projectStatus" />
- <result column="fund_type" property="fundType" />
- <result column="invest_type" property="investType" />
- <result column="project_phase" property="projectPhase" />
- <result column="tag" property="tag" />
- <result column="competent_department" property="competentDepartment" />
- <result column="area" property="area" />
- <result column="management_centralization" property="managementCentralization" />
- <result column="project_approval_type" property="projectApprovalType" />
- <result column="importance_type" property="importanceType" />
- <result column="year" property="year" />
- <result column="year_invest_amount" property="yearInvestAmount" />
- <result column="create_project_time" property="createProjectTime" />
- <result column="plan_start_time" property="planStartTime" />
- <result column="plan_complete_time" property="planCompleteTime" />
- <result column="win_unit" property="winUnit" />
- <result column="win_amount" property="winAmount" />
- <result column="win_time" property="winTime" />
- <result column="project_address" property="projectAddress" />
- <result column="longitude" property="longitude" />
- <result column="latitude" property="latitude" />
- <result column="project_owner_unit" property="projectOwnerUnit" />
- <result column="project_contact_person" property="projectContactPerson" />
- <result column="contact" property="contact" />
- <result column="gmt_create" property="gmtCreate" />
- <result column="gmt_update" property="gmtUpdate" />
- <result column="update_by" property="updateBy" />
- <result column="create_by" property="createBy" />
+ <resultMap id="resultMap" type="com.ycl.domain.vo.ProjectInfoVO" autoMapping="true">
+ <association property="projectInvestmentInfo" javaType="com.ycl.domain.vo.ProjectInvestmentInfoVO" autoMapping="true" columnPrefix="TPII_"/>
+ <association property="projectInvestmentFunding" javaType="com.ycl.domain.vo.ProjectInvestmentFundingVO" autoMapping="true" columnPrefix="TPIF_"/>
+ <association property="projectUnitRegistrationInfo" javaType="com.ycl.domain.vo.ProjectUnitRegistrationInfoVO" autoMapping="true" columnPrefix="TPURI_"/>
+ <association property="projectInvestmentPolicyCompliance" javaType="com.ycl.domain.vo.ProjectInvestmentPolicyComplianceVO" autoMapping="true" columnPrefix="TPIPC_"/>
</resultMap>
- <select id="getById" resultMap="BaseResultMap">
+ <select id="getById" resultType="com.ycl.domain.entity.ProjectInfo">
SELECT
TPI.project_name,
TPI.project_code,
@@ -82,45 +53,100 @@
</select>
- <select id="getPage" resultMap="BaseResultMap">
+ <select id="getPage" resultMap="resultMap">
SELECT
- TPI.project_name,
- TPI.project_code,
- TPI.content,
- TPI.project_type,
- TPI.project_status,
- TPI.fund_type,
- TPI.invest_type,
- TPI.project_phase,
- TPI.tag,
- TPI.competent_department,
- TPI.area,
- TPI.management_centralization,
- TPI.project_approval_type,
- TPI.importance_type,
- TPI.year,
- TPI.year_invest_amount,
- TPI.create_project_time,
- TPI.plan_start_time,
- TPI.plan_complete_time,
- TPI.win_unit,
- TPI.win_amount,
- TPI.win_time,
- TPI.project_address,
- TPI.longitude,
- TPI.latitude,
- TPI.project_owner_unit,
- TPI.project_contact_person,
- TPI.contact,
- TPI.gmt_create,
- TPI.gmt_update,
- TPI.update_by,
- TPI.create_by,
- TPI.id
+ TPI.*,
+ TPIF.total_investment as TPIF_totalInvestment,
+ TPIF.principal as TPIF_principal,TPIF.government_investment_total as TPIF_government_investment_total,TPIF.central_investment_total as TPIF_central_investment_total,
+ TPIF.central_budget_investment as TPIF_central_budget_investment,TPIF.central_fiscal_investment as TPIF_central_fiscal_investment,
+ TPIF.central_special_bond_investment as TPIF_central_special_bond_investment,TPIF.central_special_fund_investment as TPIF_central_special_fund_investment,
+ TPIF.provincial_investment_total as TPIF_provincial_investment_total,TPIF.provincial_budget_investment as TPIF_provincial_budget_investment,
+ TPIF.provincial_fiscal_investment as TPIF_provincial_fiscal_investment,TPIF.provincial_special_fund_investment as TPIF_provincial_special_fund_investment,
+ TPIF.city_investment_total as TPIF_city_investment_total,TPIF.city_budget_investment as TPIF_city_budget_investment,TPIF.city_fiscal_investment as TPIF_city_fiscal_investment,
+ TPIF.city_special_fund_investment as TPIF_city_special_fund_investment,TPIF.county_investment_total as TPIF_county_investment_total,TPIF.county_budget_investment as TPIF_county_budget_investment,
+ TPIF.county_fiscal_investment as TPIF_county_fiscal_investment,TPIF.county_special_fund_investment as TPIF_county_special_fund_investment,
+ TPIF.domestic_loan_total as TPIF_domestic_loan_total,TPIF.bank_loan as TPIF_bank_loan,TPIF.foreign_investment_total as TPIF_foreign_investment_total,
+ TPIF.enterprise_self_raised_total as TPIF_enterprise_self_raised_total,TPIF.other_investment_total as TPIF_other_investment_total,
+ TPII.be_cross_region as TPII_be_cross_region,TPII.construction_location as TPII_construction_location,
+ TPII.detailed_address as TPII_detailed_address,TPII.be_compensation_project as TPII_be_compensation_project,TPII.compensation_reason as TPII_compensation_reason,
+ TPII.planned_start_date as TPII_planned_start_date,TPII.expected_completion_date as TPII_expected_completion_date,
+ TPII.national_industry_classification as TPII_national_industry_classification,TPII.industry_classification as TPII_industry_classification,TPII.project_nature as TPII_project_nature,
+ TPII.project_attribute as TPII_project_attribute,TPII.use_earth as TPII_use_earth,TPII.content_scale as TPII_content_scale,TPII.code as TPII_code,
+ TPIPC.belongs_to_industry_adjustment_directory as TPIPC_belongs_to_industry_adjustment_directory,TPIPC.belongs_to_western_encouraged_directory as TPIPC_belongs_to_western_encouraged_directory,
+ TPIPC.not_banned_or_controlled_project as TPIPC_not_banned_or_controlled_project,TPIPC.information_is_true as TPIPC_information_is_true,
+ TPIPC.special_planning_compliance as TPIPC_special_planning_compliance,TPIPC.annual_energy_consumption as TPIPC_annual_energy_consumption,TPIPC.annual_electricity_consumption as TPIPC_annual_electricity_consumption,
+ TPIPC.energy_check as TPIPC_energy_check,TPIPC.no_only_check_type as TPIPC_no_only_check_type,TPIPC.remarks as TPIPC_remarks,
+ TPURI.total_investment as TPURI_total_investment,
+ TPURI.project_unit as TPURI_project_unit,
+ TPURI.project_unit_type as TPURI_project_unit_type,
+ TPURI.registration_type as TPURI_registration_type,
+ TPURI.holding_situation as TPURI_holding_situation,
+ TPURI.certificate_type as TPURI_certificate_type,
+ TPURI.certificate_number as TPURI_certificate_number,
+ TPURI.registered_address as TPURI_registered_address,
+ TPURI.registered_capital as TPURI_registered_capital,
+ TPURI.legal_representative as TPURI_legal_representative,
+ TPURI.fixed_phone as TPURI_fixed_phone,
+ TPURI.legal_person_idcard as TPURI_legal_person_idcard,
+ TPURI.project_contact_person as TPURI_project_contact_person,
+ TPURI.phone as TPURI_phone,
+ TPURI.contact_idcard as TPURI_contact_idcard,
+ TPURI.wechat as TPURI_wechat,
+ TPURI.contact_address as TPURI_contact_address,
+ TPURI.post_code as TPURI_post_code,
+ TPURI.email as TPURI_email
FROM
t_project_info TPI
- WHERE
+ LEFT JOIN t_project_investment_funding TPIF ON TPI.id = TPIF.project_id and TPIF.deleted = 0
+ LEFT JOIN t_project_investment_info TPII ON TPI.id = TPII.project_id and TPII.deleted = 0
+ LEFT JOIN t_project_investment_policy_compliance TPIPC ON TPI.id = TPIPC.project_id and TPIPC.deleted = 0
+ LEFT JOIN t_project_unit_registration_info TPURI ON TPI.id = TPURI.project_id and TPURI.deleted = 0
+ <where>
TPI.deleted = 0
+ <if test="query.projectCategory !=null and query.projectCategory!=''">
+ and TPI.project_phase = #{query.projectCategory}
+ </if>
+ <if test="query.projectName !=null and query.projectName!=''">
+ and TPI.project_name like concat('%',#{query.projectName},'%')
+ </if>
+ <if test="query.projectCode !=null and query.projectCode!=''">
+ and TPI.project_code like concat('%',#{query.projectCode},'%')
+ </if>
+ <if test="query.projectType !=null and query.projectType!=''">
+ and TPI.project_type = #{query.projectType}
+ </if>
+ <if test="query.importanceType !=null and query.importanceType!=''">
+ and TPI.importance_type = #{query.importanceType}
+ </if>
+ <if test="query.tag !=null and query.tag!=''">
+ and TPI.tag like concat('%',#{query.tag},'%')
+ </if>
+ <if test="query.projectStatus !=null and query.projectStatus!=''">
+ and TPI.project_status = #{query.projectStatus}
+ </if>
+ <if test="query.projectPhase !=null and query.projectPhase!=''">
+ and TPI.project_phase = #{query.projectPhase}
+ </if>
+<!-- <if test=" assignmentStatus !=null and assignmentStatus!=''">-->
+<!-- and TPI.project_phase = #{projectPhase}-->
+<!-- </if>-->
+ <if test="query.fundType !=null and query.fundType!=''">
+ and TPI.fund_type = #{query.fundType}
+ </if>
+ <if test="query.projectPhase !=null and query.projectPhase!=''">
+ and TPI.project_phase = #{query.projectPhase}
+ </if>
+ <if test="query.investType !=null and query.investType!=''">
+ and TPI.invest_type = #{query.investType}
+ </if>
+ <if test="query.area !=null and query.area!=''">
+ and TPI.area = #{query.area}
+ </if>
+ <if test="query.projectStartTime !=null and query.projectEndTime !=null">
+ and TPI.create_project_time between #{query.projectStartTime} and #{query.projectEndTime}
+ </if>
+ </where>
+ order by gmt_create
</select>
</mapper>
diff --git a/common/src/main/java/com/ycl/common/utils/CopyUtils.java b/common/src/main/java/com/ycl/common/utils/CopyUtils.java
new file mode 100644
index 0000000..5faafab
--- /dev/null
+++ b/common/src/main/java/com/ycl/common/utils/CopyUtils.java
@@ -0,0 +1,48 @@
+package com.ycl.common.utils;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
+
+import java.beans.PropertyDescriptor;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * 鑷畾涔夊鍒跺伐鍏风被
+ */
+public class CopyUtils {
+ /**
+ * 鎵�鏈変负绌哄�肩殑灞炴�ч兘涓峜opy
+ *
+ * @param source
+ * @param target
+ */
+ public static void copyNoNullProperties(Object source, Object target) {
+ BeanUtils.copyProperties(source, target, getNullField(source));
+ }
+
+ /**
+ * 鑾峰彇灞炴�т腑涓虹┖鐨勫瓧娈�
+ *
+ * @param target
+ * @return
+ */
+ private static String[] getNullField(Object target) {
+ BeanWrapper beanWrapper = new BeanWrapperImpl(target);
+ PropertyDescriptor[] propertyDescriptors = beanWrapper.getPropertyDescriptors();
+ Set<String> notNullFieldSet = new HashSet<>();
+ if (propertyDescriptors.length > 0) {
+ for (PropertyDescriptor p : propertyDescriptors) {
+ String name = p.getName();
+ Object value = beanWrapper.getPropertyValue(name);
+ if (Objects.isNull(value)) {
+ notNullFieldSet.add(name);
+ }
+ }
+ }
+ String[] notNullField = new String[notNullFieldSet.size()];
+ return notNullFieldSet.toArray(notNullField);
+ }
+}
diff --git a/common/src/main/java/com/ycl/common/utils/DateUtils.java b/common/src/main/java/com/ycl/common/utils/DateUtils.java
index b600bc6..43eaf68 100644
--- a/common/src/main/java/com/ycl/common/utils/DateUtils.java
+++ b/common/src/main/java/com/ycl/common/utils/DateUtils.java
@@ -1,6 +1,7 @@
package com.ycl.common.utils;
import java.lang.management.ManagementFactory;
+import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
@@ -9,7 +10,10 @@
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
+import java.util.Objects;
+
import org.apache.commons.lang3.time.DateFormatUtils;
+import org.springframework.lang.Nullable;
/**
* 鏃堕棿宸ュ叿绫�
@@ -188,4 +192,35 @@
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant());
}
+
+ /**
+ * 鑾峰彇鏌愬ぉ鐨勫紑濮嬫椂闂�
+ *
+ * @param date
+ * @return 2023-01-01 00:00:00
+ */
+
+ public static Date getDayStart(@Nullable Date date) {
+ if (Objects.isNull(date)) {
+ date = new Date();
+ }
+ LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.of("GMT+8"));
+ LocalDateTime of = LocalDateTime.of(localDateTime.getYear(), localDateTime.getMonth(), localDateTime.getDayOfMonth(), 0, 0, 0);
+ return Timestamp.valueOf(of);
+ }
+
+ /**
+ * 鑾峰彇鏌愬ぉ鐨勭粨鏉熸椂闂�
+ *
+ * @param date
+ * @return 2023-01-01 23:59:59
+ */
+ public static Date getDayEnd(@Nullable Date date) {
+ if (Objects.isNull(date)) {
+ date = new Date();
+ }
+ LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
+ LocalDateTime of = LocalDateTime.of(localDateTime.getYear(), localDateTime.getMonth(), localDateTime.getDayOfMonth(), 23, 59, 59);
+ return Timestamp.valueOf(of);
+ }
}
--
Gitblit v1.8.0