From c546fc702821c050cd4e427b279570b9a6cf2d5f Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Wed, 25 Aug 2021 09:45:55 +0800
Subject: [PATCH] 1.单位

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml                         |    4 +-
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml             |   27 ++++++++++---
 src/main/java/org/springblade/common/constant/FtpConstant.java                             |   16 ++++----
 src/main/java/org/springblade/modules/information/service/IInformationService.java         |    2 
 src/main/java/org/springblade/modules/information/controller/InformationController.java    |    5 +-
 src/main/java/org/springblade/modules/information/vo/InformationVO.java                    |    5 ++
 src/main/java/org/springblade/modules/information/mapper/InformationMapper.java            |    2 
 src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java |    2 
 8 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/src/main/java/org/springblade/common/constant/FtpConstant.java b/src/main/java/org/springblade/common/constant/FtpConstant.java
index ff16b99..895074e 100644
--- a/src/main/java/org/springblade/common/constant/FtpConstant.java
+++ b/src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -8,25 +8,25 @@
 	/**
 	 * sql connect
 	 */
-//	String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhba";
+	String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhba";
 
 	/**
 	 * sql connect
 	 */
-	String sql_connect_dev = "jdbc:mysql://localhost:3306/zhba";
+	//String sql_connect_dev = "jdbc:mysql://localhost:3306/zhba";
 
 	//ftp服务器IP地址
-//	String ftpHost_dev = "192.168.0.105";
+	String ftpHost_dev = "192.168.0.105";
 
 	//ftp服务器IP地址
-	String ftpHost_dev = "47.49.21.194";
+	//String ftpHost_dev = "47.49.21.194";
 
 	//ftp服务器端口
 	int ftpPort = 21;
 
 	//ftp服务器用户名
-	String ftpUserName = "ylcs";
-//	String ftpUserName = "yly";
+	//String ftpUserName = "ylcs";
+	String ftpUserName = "yly";
 
 
 	//ftp服务器密码
@@ -39,6 +39,6 @@
 	/**
 	 * 本地路径
 	 */
-	String localPath = "/home/song/anbao/";
-//	String localPath = "D:\\anbao\\";
+	//String localPath = "/home/song/anbao/";
+	String localPath = "D:\\anbao\\";
 }
diff --git a/src/main/java/org/springblade/modules/information/controller/InformationController.java b/src/main/java/org/springblade/modules/information/controller/InformationController.java
index 16a66c5..0ec747e 100644
--- a/src/main/java/org/springblade/modules/information/controller/InformationController.java
+++ b/src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -31,6 +31,7 @@
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.support.Kv;
 import org.springblade.modules.dispatcher.vo.DispatcherVO;
+import org.springblade.modules.information.vo.InformationVO;
 import org.springblade.modules.jurisdiction.service.JurisdictionService;
 import org.springblade.modules.jurisdiction.vo.JurisdictionVO;
 import org.springblade.modules.system.entity.Dept;
@@ -97,8 +98,8 @@
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入information")
-	public R<IPage<Information>> page(Information information, Query query) {
-		IPage<Information> pages = informationService.selectInformationPage(Condition.getPage(query), information);
+	public R<IPage<InformationVO>> page(InformationVO information, Query query) {
+		IPage<InformationVO> pages = informationService.selectInformationPage(Condition.getPage(query), information);
 		return R.data(pages);
 	}
 
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
index 0d0c6c0..db8cd97 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -40,7 +40,7 @@
 	 * @param information
 	 * @return
 	 */
-	List<Information> selectInformationPage(IPage page,Information information);
+	List<InformationVO> selectInformationPage(IPage page,InformationVO information);
 	void deleteIn(String creditcode);
 	void deleteSh(String creditcode);
 	void deleteMe(String creditcode);
diff --git a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
index f96e680..185feb4 100644
--- a/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
+++ b/src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -34,18 +34,31 @@
 
 
     <select id="selectInformationPage" resultMap="informationResultMap">
-        select * from sys_information where 1=1
+        SELECT
+        i.*,
+        IFNULL(A.znum ,0) as znum,
+        IFNULL(B.cnum ,0) as cnum,
+        IFNULL(C.pnum ,0) as pnum
+        FROM
+        sys_information i
+        LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 GROUP BY dept_id ) A ON A.dept_id = i.departmentid
+        LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid
+        LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND is_deleted = 0 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid
+        where  1=1
         <if test="information.enterprisename!=null and information.enterprisename!=''">
-            and enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
+            and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
         </if>
         <if test="information.representative!=null and information.representative!=''">
-            and representative like concat(concat('%', #{information.representative}),'%')
+            and i.representative like concat(concat('%', #{information.representative}),'%')
         </if>
         <if test="information.stats!=null and information.stats!=''">
-            and stats=#{stats}
+            and i.stats=#{information.stats}
         </if>
-        <if test="information.jurisdiction!=null and information.jurisdiction!=''">
-            and jurisdiction=#{jurisdiction}
+        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1123598813738675201'">
+            and i.jurisdiction=#{information.jurisdiction}
+        </if>
+        <if test="information.departmentid!=null and information.departmentid!=''">
+            and i.departmentid=#{information.departmentid}
         </if>
     </select>
 
@@ -1253,7 +1266,7 @@
             AND A.jurisdiction=#{jurisdiction}
         </if>
         <if test="deptid!=null and deptid!=''">
-            and A.dept_name like concat('%', #{deptid},'%')
+            and A.enterpriseName like concat('%', #{deptid},'%')
         </if>
     </select>
 
diff --git a/src/main/java/org/springblade/modules/information/service/IInformationService.java b/src/main/java/org/springblade/modules/information/service/IInformationService.java
index 3a4645f..ad59b29 100644
--- a/src/main/java/org/springblade/modules/information/service/IInformationService.java
+++ b/src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -41,7 +41,7 @@
 	 * @param information
 	 * @return
 	 */
-	IPage<Information> selectInformationPage(IPage<Information> page, Information information);
+	IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information);
 	void deleteIn(String ids);
 	void deleteSh(String ids);
 	void deleteMe(String ids);
diff --git a/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java b/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
index bdeac98..b7833bc 100644
--- a/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
+++ b/src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -38,7 +38,7 @@
 public class InformationServiceImpl extends ServiceImpl<InformationMapper, Information> implements IInformationService {
 
 	@Override
-	public IPage<Information> selectInformationPage(IPage<Information> page, Information information) {
+	public IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information) {
 		return page.setRecords(baseMapper.selectInformationPage(page, information));
 	}
 
diff --git a/src/main/java/org/springblade/modules/information/vo/InformationVO.java b/src/main/java/org/springblade/modules/information/vo/InformationVO.java
index 9730063..3ab7894 100644
--- a/src/main/java/org/springblade/modules/information/vo/InformationVO.java
+++ b/src/main/java/org/springblade/modules/information/vo/InformationVO.java
@@ -32,5 +32,8 @@
 @ApiModel(value = "InformationVO对象", description = "InformationVO对象")
 public class InformationVO extends Information {
 	private static final long serialVersionUID = 1L;
-
+	private String znum;
+	private String cnum;
+	private String pnum;
+	private String deptName;
 }
diff --git a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
index 11acdb5..693415c 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -228,8 +228,8 @@
         <if test="user.securitynumber!=null and user.securitynumber != ''">
             and bu.securitynumber = #{user.securitynumber}
         </if>
-        <if test="user.deptName!=null and user.deptName!=''">
-            and  bd.dept_name like concat(concat('%', #{user.deptName}),'%')
+        <if test="user.deptId!=null and user.deptId!=''">
+            and  bu.dept_id =#{user.deptId}
         </if>
         <if test="user.useName==null or user.useName==''">
             order by bu.id

--
Gitblit v1.9.3