zhao 4 сар өмнө
parent
commit
53e7d3f53d

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/controller/HandleBusinessController.java

@@ -49,7 +49,7 @@ public class HandleBusinessController {
     //查询分页matters数据
     @PostMapping("/query")
     public BaseResult findById(@RequestBody HandleMattersQuery query){
-        HashMap<Object, Object> byId = handleBusinessService.findByIds(query.getBusinessId(), query.getCurrentPage(), query.getPageSize());
+        HashMap<Object, Object> byId = handleBusinessService.findByIds(query.getBusinessId(), query.getCurrentPage(), query.getPageSize(),query.getWindowNum());
         return BaseResult.ok(byId);
     }
 

+ 5 - 3
nngkxxdp/src/main/java/com/example/nngkxxdp/dao/HandleMattersDao.java

@@ -13,7 +13,7 @@ import java.util.List;
 */
 public interface HandleMattersDao {
    // List<HandleMatters> findById(Long id);
-    int queryCount(@Param("deptId") long deptId);
+    int queryCount(@Param("deptId") long deptId,@Param("windowNum")String windowNum);
     List<HandleMatters> findById(long deptId);
 
     List<HandleMatters> findBykey(@Param("keyword") String keyword,int offset, int pageSize);
@@ -22,9 +22,11 @@ public interface HandleMattersDao {
 
     List<HandleMatters> findByKeyAll(@Param("keyword") String keyword);
 
-    List<HandleMatters> findByIdByKey(@Param("deptId") Long deptId, @Param("keyword") String keyword);
+    List<HandleMatters> findByIdByKey(@Param("deptId") Long deptId, @Param("keyword") String keyword,@Param("windowNum")String windowNum);
 
-     int findByIdByKeyCount(@Param("deptId") Long deptId, @Param("keyword") String keyword);
+     int findByIdByKeyCount(@Param("deptId") Long deptId, @Param("keyword") String keyword,@Param("windowNum")String windowNum);
+     //新增根据窗口号查询
+     List<HandleMatters> findByDeptIdAndWindowNum(@Param("deptId")long deptId, @Param("windowNum")String windowNum);
 }
 
 

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/query/HandleMattersQuery.java

@@ -8,4 +8,6 @@ public class HandleMattersQuery extends BaseQuery {
     private Long businessId;
     //查询关键字
     private String keyword;
+    //
+    private String windowNum;
 }

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/service/HandleBusinessService.java

@@ -29,7 +29,7 @@ public interface HandleBusinessService {
     void deleteById(Long id);
 
 
-    HashMap<Object, Object> findByIds(Long businessId, Integer currentPage, Integer pageSize);
+    HashMap<Object, Object> findByIds(Long businessId, Integer currentPage, Integer pageSize, String windowNum);
 
     HashMap<Object, Object> findByMatters(HandleMattersQuery query);
 }

+ 5 - 5
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/HandleBusinessServiceImpl.java

@@ -68,7 +68,7 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
     }
 
     @Override
-    public HashMap<Object, Object> findByIds(Long businessId, Integer currentPage, Integer pageSize) {
+    public HashMap<Object, Object> findByIds(Long businessId, Integer currentPage, Integer pageSize,String windowNum) {
         HashMap<Object, Object> map = new HashMap<>();
         HandleBusiness handleBusiness = handleBusinessDao.findById(businessId);
         List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
@@ -77,9 +77,9 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
         int total = 0;
         for (HandleDept handleDept : handleDepts) {
             long deptId = handleDept.getId();
-            List<HandleMatters> handleMattersList = handleMattersDao.findById(deptId);
+            List<HandleMatters> handleMattersList = handleMattersDao.findByDeptIdAndWindowNum(deptId,windowNum);
             allHandleMatters.addAll(handleMattersList);
-            total += handleMattersDao.queryCount(deptId);
+            total += handleMattersDao.queryCount(deptId,windowNum);
         }
         // 计算分页参数
         int offset = (currentPage - 1) * pageSize;
@@ -109,9 +109,9 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
         List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
         ArrayList<Object> handleMatter = new ArrayList<>();
         for (HandleDept handleDept : handleDepts) {
-            List<HandleMatters> HandleMatters = handleMattersDao.findByIdByKey(handleDept.getId(), query.getKeyword());
+            List<HandleMatters> HandleMatters = handleMattersDao.findByIdByKey(handleDept.getId(), query.getKeyword(),query.getWindowNum());
             handleMatter.addAll(HandleMatters);
-            total += handleMattersDao.findByIdByKeyCount(handleDept.getId(), query.getKeyword());
+            total += handleMattersDao.findByIdByKeyCount(handleDept.getId(), query.getKeyword(), query.getWindowNum());
         }
 
         // 计算分页参数

+ 16 - 0
nngkxxdp/src/main/resources/mapper/HandleMattersDao.xml

@@ -28,6 +28,9 @@
     <select id="queryCount" resultType="int">
         select count(*) from t_handle_matters hm
         where hm.deptId=#{deptId}
+        <if test="windowNum != null and windowNum != ''">
+            and window_num like concat('%', #{windowNum}, '%')
+        </if>
     </select>
     <select id="queryData" resultType="com.example.nngkxxdp.entity.HandleMatters">
         select hm.id,hm.matters_name,hm.window_num from t_handle_matters hm
@@ -55,6 +58,9 @@
         <if test="keyword != null and keyword != ''">
             and matters_name like concat('%', #{keyword}, '%')
         </if>
+        <if test="windowNum != null and windowNum != ''">
+            and window_num like concat('%', #{windowNum}, '%')
+        </if>
     </select>
     <select id="findByIdByKeyCount" resultType="java.lang.Integer">
         select count(*) from t_handle_matters
@@ -62,6 +68,16 @@
         <if test="keyword != null and keyword != ''">
             and matters_name like concat('%', #{keyword}, '%')
         </if>
+        <if test="windowNum != null and windowNum != ''">
+            and window_num like concat('%', #{windowNum}, '%')
+        </if>
+    </select>
+    <select id="findByDeptIdAndWindowNum" resultType="com.example.nngkxxdp.entity.HandleMatters">
+        select hm.id,hm.matters_name,hm.window_num,hm.url from t_handle_matters hm
+        where hm.deptId=#{deptId}
+        <if test="windowNum != null and windowNum != ''">
+            and window_num like concat('%', #{windowNum}, '%')
+        </if>
     </select>
 
 </mapper>