浏览代码

部门查询选择父级部门可查询子集部门数据

user5 4 年之前
父节点
当前提交
87a1d5082f
共有 18 个文件被更改,包括 224 次插入68 次删除
  1. 16 6
      src/main/java/com/jeeplus/common/persistence/DataEntity.java
  2. 9 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java
  3. 6 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  4. 6 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  5. 9 1
      src/main/java/com/jeeplus/modules/sys/dao/OfficeDao.java
  6. 14 4
      src/main/java/com/jeeplus/modules/sys/service/OfficeService.java
  7. 6 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java
  8. 6 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  9. 6 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementAllService.java
  10. 8 0
      src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java
  11. 6 0
      src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java
  12. 17 5
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml
  13. 16 2
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml
  14. 18 2
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  15. 4 0
      src/main/resources/mappings/modules/sys/OfficeDao.xml
  16. 16 4
      src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml
  17. 38 26
      src/main/resources/mappings/modules/workreimbursement/WorkReimbursementDao.xml
  18. 23 17
      src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

+ 16 - 6
src/main/java/com/jeeplus/common/persistence/DataEntity.java

@@ -4,6 +4,7 @@
 package com.jeeplus.common.persistence;
 
 import java.util.Date;
+import java.util.List;
 
 import com.jeeplus.common.config.Global;
 import org.apache.commons.lang3.StringUtils;
@@ -23,7 +24,7 @@ import com.jeeplus.modules.sys.utils.UserUtils;
 public abstract class DataEntity<T> extends BaseEntity<T> {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	protected transient String remarks;	// 备注
 	protected transient User createBy;	// 创建者
 	protected transient Date createDate;	// 创建日期
@@ -31,6 +32,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 	protected transient Date updateDate;	// 更新日期
 	protected transient String delFlag; 	// 删除标记(0:正常;1:删除;2:审核)
 	protected transient String uploadMode = Global.getConfig("remoteServer.uploadMode");
+	protected List<String> officeIdList;
 
 	protected transient String toflag; 	// 判定是否从列表进行查询
 
@@ -38,11 +40,11 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 		super();
 		this.delFlag = DEL_FLAG_NORMAL;
 	}
-	
+
 	public DataEntity(String id) {
 		super(id);
 	}
-	
+
 	/**
 	 * 插入之前执行方法,需要手动调用
 	 */
@@ -60,7 +62,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 		this.updateDate = new Date();
 		this.createDate = this.updateDate;
 	}
-	
+
 	/**
 	 * 更新之前执行方法,需要手动调用
 	 */
@@ -72,7 +74,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 		}
 		this.updateDate = new Date();
 	}
-	
+
 	@Length(min=0, max=255)
 	public String getRemarks() {
 		return remarks;
@@ -81,7 +83,7 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
 	}
-	
+
 	@JsonIgnore
 	public User getCreateBy() {
 		return createBy;
@@ -143,4 +145,12 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 	public void setToflag(String toflag) {
 		this.toflag = toflag;
 	}
+
+	public List<String> getOfficeIdList() {
+		return officeIdList;
+	}
+
+	public void setOfficeIdList(List<String> officeIdList) {
+		this.officeIdList = officeIdList;
+	}
 }

+ 9 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java

@@ -13,6 +13,7 @@ import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageAllDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.*;
 import com.jeeplus.modules.sys.entity.*;
+import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
@@ -59,6 +60,8 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
     private WorkClientLinkmanDao workClientLinkmanDao;
     @Autowired
     private WorkProjectNotifyService workProjectNotifyService;
+    @Autowired
+    private OfficeService officeService;
 
     public RuralProjectRecords get(String id) {
         return super.get(id);
@@ -75,7 +78,12 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
             Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
             projectRecords.setEndingCount(endingCount);
         }
-
+        if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
+            officeIdList.add(projectRecords.getOffice().getId());
+            projectRecords.setOfficeIdList(officeIdList);
+        }
         int count = dao.queryCount(projectRecords);
         page.setCount(count);
         page.setCountFlag(false);

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -234,6 +234,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             projectRecords.setEndingCount(endingCount);
         }
 
+        if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
+            officeIdList.add(projectRecords.getOffice().getId());
+            projectRecords.setOfficeIdList(officeIdList);
+        }
         int count = dao.queryCount(projectRecords);
         page.setCount(count);
         page.setCountFlag(false);

+ 6 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -272,6 +272,12 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
             projectRecords.getSqlMap().put("dsf", dataScopeSql);
 			projectRecords.getSqlMap().put("delFlag", "AND a.del_flag = 0");
         }
+        if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
+        	//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
+			officeIdList.add(projectRecords.getOffice().getId());
+			projectRecords.setOfficeIdList(officeIdList);
+		}
         int count = dao.queryCount(projectRecords);
         page.setCount(count);
         page.setCountFlag(false);

+ 9 - 1
src/main/java/com/jeeplus/modules/sys/dao/OfficeDao.java

@@ -17,7 +17,7 @@ import java.util.List;
  */
 @MyBatisDao
 public interface OfficeDao extends TreeDao<Office> {
-	
+
 	public Office getByCode(String code);
 	public void saveBranchOffice(Office office);
 	public void updateUseable(Office office);
@@ -87,4 +87,12 @@ public interface OfficeDao extends TreeDao<Office> {
 	 * @return
 	 */
 	List<Office> findByParentIdsByProjectId(Office office);
+
+
+	/**
+	 * 根据父节点查询包含父节点的所有部门信息
+	 * @param parentId
+	 * @return
+	 */
+	List<String> getChildrenOffice(String parentId);
 }

+ 14 - 4
src/main/java/com/jeeplus/modules/sys/service/OfficeService.java

@@ -52,7 +52,7 @@ public class OfficeService extends TreeService<OfficeDao, Office> {
     @Autowired
     @Lazy
     private SystemService systemService;
-	
+
 	public List<Office> findAll(){
 		return UserUtils.getOfficeList();
 	}
@@ -170,7 +170,7 @@ public class OfficeService extends TreeService<OfficeDao, Office> {
 		List<Office> list = officeDao.findByParentIdsLikee(office);
 		return list;
 	}
-	
+
 	@Transactional(readOnly = true)
      public List<Office> findByGroupId(String groupId){
         return dao.findByGroupId(groupId);
@@ -185,8 +185,8 @@ public class OfficeService extends TreeService<OfficeDao, Office> {
     public Office getByCode(String code){
         return dao.getByCode(code);
     }
-	
-	
+
+
 	@Transactional(readOnly = false)
 	public void save(Office office) {
 		super.save(office);
@@ -339,4 +339,14 @@ public class OfficeService extends TreeService<OfficeDao, Office> {
 		}
 		return integer;
 	}
+
+	/**
+	 * 根据父节点查询包含父节点的所有部门信息
+	 * @param parentId
+	 * @return
+	 */
+	public List<String> getChildrenOffice(String parentId){
+		List<String> offices = officeDao.getChildrenOffice(parentId);
+		return offices;
+	}
 }

+ 6 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceAllService.java

@@ -185,6 +185,12 @@ public class WorkInvoiceAllService extends CrudService<WorkInvoiceDao, WorkInvoi
 
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 //		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
+		}
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
 		page.setCountFlag(false);

+ 6 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -221,6 +221,12 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
+		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){
+			//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(workInvoice.getOfficeId());
+			officeIdList.add(workInvoice.getOfficeId());
+			workInvoice.setOfficeIdList(officeIdList);
+		}
 		int count = dao.queryCount(workInvoice);
 		page.setCount(count);
 		page.setCountFlag(false);

+ 6 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementAllService.java

@@ -237,6 +237,12 @@ public class WorkReimbursementAllService extends CrudService<WorkReimbursementDa
 //        if (matcher.find()) {
 //            workReimbursement.getSqlMap().put("dsf",str.substring(0,matcher.start()) + str.substring(matcher.start()+3));
 //        }
+        if(StringUtils.isNotBlank(workReimbursement.getOfficeId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(workReimbursement.getOfficeId());
+            officeIdList.add(workReimbursement.getOfficeId());
+            workReimbursement.setOfficeIdList(officeIdList);
+        }
         workReimbursement.setCreateBy(UserUtils.getUser());
         int count = dao.queryCount(workReimbursement);
         page.setCount(count);

+ 8 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementService.java

@@ -254,6 +254,14 @@ public class WorkReimbursementService extends CrudService<WorkReimbursementDao,
             workReimbursement.getSqlMap().put("dsf",str.substring(0,matcher.start()) + str.substring(matcher.start()+3));
         }
         workReimbursement.setCreateBy(UserUtils.getUser());
+        if(StringUtils.isNotBlank(workReimbursement.getOfficeId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(workReimbursement.getOfficeId());
+            officeIdList.add(workReimbursement.getOfficeId());
+            workReimbursement.setOfficeIdList(officeIdList);
+        }
+
+
         int count = dao.queryCount(workReimbursement);
         page.setCount(count);
         page.setCountFlag(false);

+ 6 - 0
src/main/java/com/jeeplus/modules/workstaff/service/WorkStaffBasicInfoService.java

@@ -195,6 +195,12 @@ public class WorkStaffBasicInfoService extends CrudService<WorkStaffBasicInfoDao
                 workStaffBasicInfo.getCurrentUser().setBranchOffice(workStaffBasicInfo.getCurrentUser().getCompany());
             }
         }
+        if(null!= workStaffBasicInfo.getOffice() && StringUtils.isNotBlank(workStaffBasicInfo.getOffice().getId())){
+            //查询该选择节点下所有的部门Id
+            List<String> officeIdList = officeService.getChildrenOffice(workStaffBasicInfo.getOffice().getId());
+            officeIdList.add(workStaffBasicInfo.getOffice().getId());
+            workStaffBasicInfo.setOfficeIdList(officeIdList);
+        }
 		return super.findPage(page, workStaffBasicInfo);
 	}
 	//微信

+ 17 - 5
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -46,8 +46,8 @@
 		ifnull(a.reported_state,0) as "reportedState",
 		a.over_due_status as "overDueStatus"
 	</sql>
-	
-    
+
+
 	<select id="get" resultType="RuralProjectRecords" >
 		SELECT
 			<include refid="projectRecordsColumns"/>
@@ -210,8 +210,14 @@
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="projectReportStatus != null and projectReportStatus != ''">
 				AND prd.status = #{projectReportStatus}
@@ -367,8 +373,14 @@
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="projectReportStatus != null and projectReportStatus != ''">
 				AND prd.status = #{projectReportStatus}
@@ -419,4 +431,4 @@
             </if>
         </where>
     </select>
-</mapper>
+</mapper>

+ 16 - 2
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -443,9 +443,17 @@
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
+
             <if test="reportedState !=null and reportedState !=''">
 				<choose>
 					<when test="reportedState == 0">
@@ -605,8 +613,14 @@
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="projectReportStatus != null and projectReportStatus != ''">
 				AND prd.status = #{projectReportStatus}

+ 18 - 2
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -204,9 +204,16 @@
 			<if test="engineeringType !=null and engineeringType !=''">
 				and a.engineering_type= #{engineeringType}
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
+
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>
@@ -308,9 +315,18 @@
 			<if test="engineeringType !=null and engineeringType !=''">
 				and a.engineering_type= #{engineeringType}
 			</if>
-			<if test="office!=null and office.id!=null and office.id!=''">
+			<!--<if test="office!=null and office.id!=null and office.id!=''">
 				and  a.office_id = #{office.id}
+			</if>-->
+
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
+
+
 			<if test="reportData!=null and reportData.number !=null and reportData.number !=''">
 				and prd.number like concat('%',#{reportData.number},'%')
 			</if>

+ 4 - 0
src/main/resources/mappings/modules/sys/OfficeDao.xml

@@ -764,4 +764,8 @@
 	<select id="findWechatId" resultType="java.lang.Integer">
 		SELECT wx_office_id FROM sys_office where id = #{officeId}
 	</select>
+
+	<select id="getChildrenOffice" resultType="java.lang.String">
+		SELECT id FROM sys_office a WHERE a.parent_ids like CONCAT('%',#{parentId},'%') and del_flag = 0
+	</select>
 </mapper>

+ 16 - 4
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -141,9 +141,9 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
-			<if test="officeId != null and officeId != ''">
+			<!--<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
-			</if>
+			</if>-->
 			<if test="money != null and money != ''">
 				AND a.money = #{money}
 			</if>
@@ -171,8 +171,14 @@
 			<if test="companyId != null and companyId != ''">
 				AND a.company_id = #{companyId}
 			</if>
-			<if test="office != null and office.id != null and office.id != ''">
+			<!--<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="invoiceNumber != null and invoiceNumber != ''">
 				AND a.invoice_number LIKE
@@ -390,8 +396,14 @@
 				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
 				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
 			</if>
-			<if test="officeId != null and officeId != ''">
+			<!--<if test="officeId != null and officeId != ''">
 				AND so.id  = #{officeId}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<!--<if test="submitterId != null and submitterId != ''">
 				AND a.create_by = #{submitterId}

+ 38 - 26
src/main/resources/mappings/modules/workreimbursement/WorkReimbursementDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.workreimbursement.dao.WorkReimbursementDao">
-    
+
 	<sql id="workReimbursementColumns">
 		a.id AS "id",
 		a.process_instance_id AS "processInstanceId",
@@ -35,14 +35,14 @@
 		a.create_office as "createOffice",
 		a.type as "type"
 	</sql>
-	
+
 	<sql id="workReimbursementJoins">
         LEFT JOIN rural_project_records p on p.id = a.project_id
 	</sql>
-	
-    
+
+
 	<select id="get" resultType="WorkReimbursement" >
-		SELECT 
+		SELECT
 			<include refid="workReimbursementColumns"/>,
 		a.money AS "money"
 		,a.office_id as "officeId"
@@ -52,9 +52,9 @@
 		left join sys_user su on su.id = a.submitter_id
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="WorkReimbursement" >
-		SELECT 
+		SELECT
 			<include refid="workReimbursementColumns"/>
 		,wa.reimbursement_name AS "submitterId"
 		,wa.money as "money"
@@ -81,8 +81,14 @@
 			<if test="status != '' and status != null">
 				AND a.status = #{status}
 			</if>
-			<if test="officeId != '' and officeId != null">
+			<!--<if test="officeId != '' and officeId != null">
 				AND wa.office_id = #{officeId}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and wa.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="submitterDate != '' and submitterDate != null">
 				AND a.submitter_date = #{submitterDate}
@@ -138,8 +144,14 @@
 			<if test="status != '' and status != null">
 				AND a.status = #{status}
 			</if>
-			<if test="officeId != '' and officeId != null">
+			<!--<if test="officeId != '' and officeId != null">
 				AND wa.office_id = #{officeId}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and wa.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="submitterDate != '' and submitterDate != null">
 				AND a.submitter_date = #{submitterDate}
@@ -176,16 +188,16 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="WorkReimbursement" >
-		SELECT 
+		SELECT
 			<include refid="workReimbursementColumns"/>,
 		a.money AS "money"
 		FROM work_reimbursement a
 		<include refid="workReimbursementJoins"/>
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
-		</where>		
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -195,13 +207,13 @@
 			</otherwise>
 		</choose>
 	</select>
-		
+
 	<update id="updateProcessInstanceId">
-		UPDATE work_reimbursement SET 
+		UPDATE work_reimbursement SET
 			process_instance_id = #{processInstanceId}
 		WHERE id = #{id}
 	</update>
-	
+
 	<insert id="insert">
 		INSERT INTO work_reimbursement(
 			id,
@@ -270,9 +282,9 @@
 
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE work_reimbursement SET 	
+		UPDATE work_reimbursement SET
 			number = #{number},
 			business_type = #{businessType},
 			<if test="officeId != null and officeId !=''">
@@ -306,27 +318,27 @@
 		    type = #{type}
 		WHERE id = #{id}
 	</update>
-	
-	
+
+
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM work_reimbursement
 		WHERE id = #{id}
 	</update>
-	
+
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
-		UPDATE work_reimbursement SET 
+		UPDATE work_reimbursement SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id}
 	</update>
-	
-	
+
+
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
 	<select id="findUniqueByProperty" resultType="WorkReimbursement" statementType="STATEMENT">
 		select * FROM work_reimbursement  where ${propertyName} = '${value}'
 	</select>
-	
+
 	<select id="findListByproject" resultType="WorkBidProject">
 		select
 		a.id AS "id",
@@ -381,7 +393,7 @@
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
 			<if test="name != null and name != ''">
-				AND a.name LIKE 
+				AND a.name LIKE
 				<if test="dbName == 'oracle'">#{name}||'%'</if>
 				<if test="dbName == 'mssql'">#{name}+'%'</if>
 				<if test="dbName == 'mysql'">concat(#{name},'%')</if>
@@ -438,4 +450,4 @@
 
 
 
-</mapper>
+</mapper>

+ 23 - 17
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.workstaff.dao.WorkStaffBasicInfoDao">
-    
+
 	<sql id="workStaffBasicInfoColumns">
 		a.id AS "id",
 		a.create_by AS "createBy.id",
@@ -61,7 +61,7 @@
 <!--		ur.role_id AS "roleId",-->
 <!--		r.name AS "roleName"-->
 	</sql>
-	
+
 	<sql id="workStaffBasicInfoJoins">
 		LEFT JOIN sys_office o ON o.id = a.office_id
 		LEFT JOIN sys_office branch ON branch.id = a.branch_office
@@ -162,7 +162,7 @@
 	</select>
 
 	<select id="findList" resultType="WorkStaffBasicInfo" >
-		SELECT 
+		SELECT
 			<include refid="workStaffBasicInfoColumns"/>
 		,su.name as "auditUserName"
 		FROM work_staff_basic_info a
@@ -173,14 +173,20 @@
 			<if test="company != null and company.id != null and company.id != ''">
 				AND a.company_id = #{company.id}
 			</if>
-			<if test="office != null and office.id != null and office.id != ''">
+			<!--<if test="office != null and office.id != null and office.id != ''">
 				AND a.office_id = #{office.id}
+			</if>-->
+			<if test="officeIdList!=null and officeIdList.size!=0">
+				and a.office_id in
+				<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+					#{officeId}
+				</foreach>
 			</if>
 			<if test="no != null and no != ''">
 				AND a.no = #{no}
 			</if>
 			<if test="name != null and name != ''">
-				AND a.name LIKE 
+				AND a.name LIKE
 					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
@@ -276,15 +282,15 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<select id="findAllList" resultType="WorkStaffBasicInfo" >
-		SELECT 
+		SELECT
 			<include refid="workStaffBasicInfoColumns"/>
 		FROM work_staff_basic_info a
 		<include refid="workStaffBasicInfoJoins"/>
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL}
-		</where>		
+		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -294,7 +300,7 @@
 			</otherwise>
 		</choose>
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO work_staff_basic_info(
 			id,
@@ -396,9 +402,9 @@
 			#{individualResume}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE work_staff_basic_info SET 	
+		UPDATE work_staff_basic_info SET
 			update_by = #{updateBy.id},
 			update_date = #{updateDate},
 			remarks = #{remarks},
@@ -445,21 +451,21 @@
 			individual_resume = #{individualResume}
 		WHERE id = #{id}
 	</update>
-	
-	
+
+
 	<!--物理删除-->
 	<update id="delete">
 		DELETE FROM work_staff_basic_info
 		WHERE id = #{id}
 	</update>
-	
+
 	<!--逻辑删除-->
 	<update id="deleteByLogic">
-		UPDATE work_staff_basic_info SET 
+		UPDATE work_staff_basic_info SET
 			del_flag = #{DEL_FLAG_DELETE}
 		WHERE id = #{id}
 	</update>
-	
+
 	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
 	<select id="findUniqueByProperty" resultType="WorkStaffBasicInfo" statementType="STATEMENT">
 		select * FROM work_staff_basic_info  where ${propertyName} = '${value}'
@@ -673,4 +679,4 @@
 		WHERE a.name = #{name} and a.del_flag = 0
 	</select>
 
-</mapper>
+</mapper>