Sfoglia il codice sorgente

task-4651 sql注入新增接口
移动端-用户信息沟通查询

xiexh 9 mesi fa
parent
commit
87e9e92c25

+ 2 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/sqlzdy/Service/SwdlService.java

@@ -25,4 +25,6 @@ public interface SwdlService {
     APIResult queryAttendanceData(@RequestBody(required = true) Map<String,Object> map)throws Exception ;
 
     APIResult queryClassAdjustmentList(@RequestBody(required = true) Map<String,Object> map)throws Exception ;
+
+    APIResult queryUserCommunicateList(@RequestBody(required = true) Map<String,Object> map)throws Exception ;
 }

+ 48 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/sqlzdy/Service/SwdlServiceImpl.java

@@ -261,7 +261,55 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
         }
         return result;
     }
+    @Override
+    public APIResult queryUserCommunicateList(
+            @ApiParam(name = "request", value = "传入查询请求map对象", required = true)
+            @RequestBody(required = true) Map<String,Object> map) throws Exception  {
+        APIResult<Object> result = new APIResult<>();
+        try {
+            int pageNo = Integer.parseInt(map.get("pageNo").toString());
+            int limit = Integer.parseInt(map.get("limit").toString());
+            int startPage = limit*(pageNo-1);
+            map.put("startPage",startPage);
+            HashMap<String, Object> stringObjectHashMap = new HashMap<>();
+            if (BeanUtils.isNotEmpty(map)) {
+                stringObjectHashMap.put("pageNo", map.get("pageNo"));
+                stringObjectHashMap.put("limit", map.get("limit"));
+                stringObjectHashMap.put("startPage", map.get("startPage"));
+                if(BeanUtils.isNotEmpty(map.get("param"))){
+                    Map param = (Map) map.get("param");
+                   if(BeanUtils.isNotEmpty(param.get("createBy"))){
+                       stringObjectHashMap.put("createBy",param.get("createBy"));
+                   }
+                    if(BeanUtils.isNotEmpty(param.get("xuanZeKeHu"))){
+                        stringObjectHashMap.put("xuanZeKeHu",param.get("xuanZeKeHu"));
+                    }
+                    if(BeanUtils.isNotEmpty(param.get("gouTongLeiXing"))){
+                        stringObjectHashMap.put("gouTongLeiXing",param.get("gouTongLeiXing"));
+                    }
+                    if(BeanUtils.isNotEmpty(param.get("biaoDanBianHao"))){
+                        stringObjectHashMap.put("biaoDanBianHao",param.get("biaoDanBianHao"));
+                    }
+                    if(BeanUtils.isNotEmpty(param.get("keHuLianXiRen"))){
+                        stringObjectHashMap.put("keHuLianXiRen",param.get("keHuLianXiRen"));
+                    }
+                }
+            }
 
+            List<Map<String,Object>> list = updateDataTableDao.queryUserCommunicateList(stringObjectHashMap);
+            int totalCount = updateDataTableDao.queryUserCommunicateListCount(stringObjectHashMap);
+            APIPageList<Map<String,Object>> pageList = getAPIPageList(list);
+            APIPageResult pageResult = new APIPageResult();
+            pageResult.setTotalCount(totalCount);
+            pageResult.setLimit(limit);
+            pageResult.setPage(pageNo);
+            pageList.setPageResult(pageResult);
+            result.setData(pageList);
+        } catch (Exception e) {
+            setExceptionResult(result, StateEnum.ERROR_FORM_BO.getCode(), I18nUtil.getMessage(StateEnum.ERROR_FORM_BO.getCode()+""), e);
+        }
+        return result;
+    }
     private Map getAttendanceMap(Map<String, Object> map) {
         HashMap<String, Object> stringObjectHashMap = new HashMap<>();
         if (BeanUtils.isNotEmpty(map)) {

+ 12 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/sqlzdy/control/SwdlController.java

@@ -103,4 +103,16 @@ public class SwdlController extends GenericProvider {
         return result;
 
     }
+    @ApiOperation("移动端-用户信息沟通查询")
+    @PostMapping("/mobile/communicate/queryData")
+    APIResult queryUserCommunicateList(@RequestBody(required = true) Map<String,Object> map) throws Exception{
+        APIResult result = new APIResult<>();
+        try {
+            result = swdlService.queryUserCommunicateList(map);
+        } catch (Exception e) {
+            setExceptionResult(result, StateEnum.ILLEGAL_REQUEST.getCode(), I18nUtil.getMessage(StateEnum.ILLEGAL_REQUEST.getCode() + ""), e);
+        }
+        return result;
+
+    }
 }

+ 4 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/sysdata/dao/UpdateDataTableDao.java

@@ -6,6 +6,7 @@ import com.lc.ibps.sysdata.entity.User;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -103,4 +104,7 @@ public interface UpdateDataTableDao {
     int selectClassAdjustmentListCount(@Param("map") Map<String, Object> map);
 
 
+    List<Map<String, Object>> queryUserCommunicateList(@Param("map")  Map<String, Object> map);
+
+    int queryUserCommunicateListCount(@Param("map") Map<String, Object> map);
 }

+ 39 - 0
ibps-provider-root/modules/provider-business/src/main/resources/com/lc/ibps/klimsibps/mapping/UpdateDataTableMapper.xml

@@ -685,4 +685,43 @@
             create_by_ = #{map.userId}
         </where>
     </select>
+    <select id="queryUserCommunicateList" resultType="java.util.Map" parameterType="java.util.Map">
+        SELECT
+            *
+        FROM
+            t_khgtjlb
+        <where>
+            (create_by_ = #{map.createBy} or xuan_ze_ke_hu_ = #{map.xuanZeKeHu})
+            <if test="@o.Ognl@isNotEmpty(map.gouTongLeiXing)">
+                AND gou_tong_lei_xing = #{map.gouTongLeiXing}
+            </if>
+            <if test="@o.Ognl@isNotEmpty(map.biaoDanBianHao)">
+                AND biao_dan_bian_hao like CONCAT('%', #{map.biaoDanBianHao}, '%')
+            </if>
+            <if test="@o.Ognl@isNotEmpty(map.keHuLianXiRen)">
+                AND ke_hu_lian_xi_ren like CONCAT('%', #{map.keHuLianXiRen}, '%')
+            </if>
+        </where>
+        ORDER BY
+            create_time_ DESC
+            limit ${map.startPage},${map.limit}
+    </select>
+    <select id="queryUserCommunicateListCount" resultType="java.lang.Integer" parameterType="java.util.Map">
+        SELECT
+        count(*)
+        FROM
+        t_khgtjlb
+        <where>
+            (create_by_ = #{map.createBy} or xuan_ze_ke_hu_ = #{map.xuanZeKeHu})
+            <if test="@o.Ognl@isNotEmpty(map.gouTongLeiXing)">
+                AND gou_tong_lei_xing = #{map.gouTongLeiXing}
+            </if>
+            <if test="@o.Ognl@isNotEmpty(map.biaoDanBianHao)">
+                AND biao_dan_bian_hao like CONCAT('%', #{map.biaoDanBianHao}, '%')
+            </if>
+            <if test="@o.Ognl@isNotEmpty(map.keHuLianXiRen)">
+                AND ke_hu_lian_xi_ren like CONCAT('%', #{map.keHuLianXiRen}, '%')
+            </if>
+        </where>
+    </select>
 </mapper>