liyg 2 anni fa
parent
commit
ba6940c5dd

+ 21 - 0
src/main/java/com/steerinfo/dil/controller/DilNoticeController.java

@@ -320,5 +320,26 @@ public class DilNoticeController extends BaseRESTfulController {
         return success(noticeData);
     }
 
+    @ApiOperation(value = "模糊查询通知信息", notes = "分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "196", required = false, dataType = "BigDecimal"),
+    })
+    @PostMapping(value = "/getNoticeUser")
+    public RESTfulResult getNoticeUser(@RequestBody(required = false) Map<String, Object> mapValue,
+                                             @RequestParam("pageNum") Integer pageNum,
+                                             @RequestParam("pageSize") Integer pageSize,
+                                             @RequestParam("apiId") Integer apiId) {
+        if (mapValue==null){
+            mapValue=new HashMap<>();
+        }
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = dilNoticeService.getNoticeUser(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
+        return success(data);
+    }
+
 
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/DilNoticeMapper.java

@@ -164,4 +164,6 @@ public interface DilNoticeMapper extends IBaseMapper<DilNotice, BigDecimal> {
      * @return
      */
     int readAll(Map<String, Object> map);
+
+    List<Map<String, Object>>  getNoticeUser(Map<String, Object> mapValue);
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/IDilNoticeService.java

@@ -55,4 +55,6 @@ public interface IDilNoticeService {
 
     List<Map<String,Object>> getCarrierId();*/
 
+    List<Map<String, Object>> getNoticeUser(Map<String,Object> mapValue);
+
 }

+ 5 - 0
src/main/java/com/steerinfo/dil/service/impl/DilNoticeServiceImpl.java

@@ -330,4 +330,9 @@ public class DilNoticeServiceImpl  implements IDilNoticeService {
     public int readAll(Map<String, Object> map) {
         return dilNoticeMapper.readAll(map);
     }
+
+    @Override
+    public List<Map<String, Object>> getNoticeUser(Map<String, Object> mapValue) {
+        return dilNoticeMapper.getNoticeUser(mapValue);
+    }
 }

+ 24 - 0
src/main/resources/com/steerinfo/dil/mapper/DilNoticeMapper.xml

@@ -812,4 +812,28 @@
       WHERE INSERT_USERNAME = #{insertUserName}
     )
   </update>
+
+  <select id="getNoticeUser" resultType="java.util.Map">
+    SELECT DN.NOTICE_TITLE AS "noticetitle",
+    DN.NOTICE_CONTENT AS "noticecontent",
+    DN.INSERT_USERNAME AS "insertusername",
+    DN.INSERT_TIME AS "inserttime",
+    DN.NOTICE_ID AS "noticeId",
+    SU .USER_NAME "userName",
+    decode(DNU.STATUS,1,'已读','未读') "status"
+    FROM DIL_NOTICE	DN
+    LEFT JOIN DIL_NOTICE_USERS DNU ON DNU .NOTICE_ID=DN .NOTICE_ID
+    LEFT JOIN SSO.SYS_USER SU ON SU .USER_ID = DNU .USER_ID
+    <where>
+      <if test="noticeId!=null">
+        AND DNU.NOTICE_ID=#{noticeId}
+      </if>
+      <if test="userId!=null">
+        AND DNU.USER_ID=#{userId}
+      </if>
+      AND DNU.NOTICE_ID IS NOT NULL
+      AND SYSDATE > DN.INSERT_TIME
+      ORDER BY DN.INSERT_TIME DESC
+    </where>
+  </select>
 </mapper>