Browse Source

航司表查询全部接口

dongql 7 years ago
parent
commit
48224a127b

+ 19 - 0
oa_service/src/main/java/com/bjlt/spider/table/controller/AirSourceMenuController.java

@@ -99,4 +99,23 @@ public class AirSourceMenuController {
         }
         return RespEntity.success("false");
     }
+
+
+    /**
+     * 查询全部
+     * @param airSourceMenuVo
+     * @return
+     */
+    @RequestMapping(value = "findAll",method = RequestMethod.POST)
+    @ResponseBody
+    public LayuiTableRespEntity listAirSourceMenu(AirSourceMenuVo airSourceMenuVo){
+        LayuiTableRespEntity layuiTableRespEntity = new LayuiTableRespEntity();
+        airSourceMenuVo.setStatus(1);
+        List<AirSourceMenuVo> airSourceMenuVos = airSourceMenuService.listAirSourceMenu(airSourceMenuVo);
+        layuiTableRespEntity.setCount(airSourceMenuVo.getTotal());
+        layuiTableRespEntity.setList(airSourceMenuVos);
+        layuiTableRespEntity.setMsg("成功");
+        layuiTableRespEntity.setRel(true);
+        return layuiTableRespEntity;
+    }
 }

+ 2 - 0
oa_service/src/main/java/com/bjlt/spider/table/dao/AirSourceMenuDao.java

@@ -17,4 +17,6 @@ public interface AirSourceMenuDao {
 
     AirSourceMenuVo selectById(String id);
 
+    List<AirSourceMenuVo> listAirSourceMenu(AirSourceMenuVo airSourceMenuVo);
+
 }

+ 20 - 1
oa_service/src/main/java/com/bjlt/spider/table/dao/impl/AirSourceMenuDaoImpl.java

@@ -34,7 +34,7 @@ public class AirSourceMenuDaoImpl implements AirSourceMenuDao {
     @Override
     public List<AirSourceMenuVo> listPageAirSourceMenu(AirSourceMenuVo airSourceMenuVo){
         StringBuffer stringBuffer = new StringBuffer();
-        String select ="select id ,group_id,postfix,source_group,source_name,is_default,search_url,verify_url as verufyUrl,order_url,pay_url,passenger_count,edit_user,update_time,add_time,status from sc_airsource_menu ";
+        String select ="select id ,group_id,postfix,source_group,source_name,is_default,search_url,verify_url as verufyUrl,order_url as orderUrl,pay_url as payUrl,passenger_count as passengerCount,edit_user as editUser,update_time as updateTime,add_time as addTime,status from sc_airsource_menu ";
         stringBuffer.append(select);
         Map<String,Object> map = map(airSourceMenuVo);
         String where = " where 1 = 1 " + map.keySet().stream().map(t -> " and " + t + "=?").collect(Collectors.joining(" "));
@@ -120,6 +120,25 @@ public class AirSourceMenuDaoImpl implements AirSourceMenuDao {
         return airSourceMenuVo;
     }
 
+    /**
+     * 查询全部数据
+     * @param airSourceMenuVo
+     * @return
+     */
+    @Override
+    public List<AirSourceMenuVo> listAirSourceMenu(AirSourceMenuVo airSourceMenuVo) {
+        StringBuffer stringBuffer = new StringBuffer();
+        String select = "select id ,group_id,postfix,source_group,source_name,is_default,search_url,verify_url as verufyUrl,order_url as orderUrl,pay_url as payUrl,passenger_count as passengerCount,edit_user as editUser,update_time as updateTime,add_time as addTime,status from sc_airsource_menu ";
+        stringBuffer.append(select);
+        Map<String,Object> map = map(airSourceMenuVo);
+        String where = " where 1 = 1 " + map.keySet().stream().map(t -> " and " + t + "=?").collect(Collectors.joining(" "));
+        airSourceMenuVo.setTotal(count(where,map.values().toArray()));
+        stringBuffer.append(where);
+        RowMapper<AirSourceMenuVo> rowMapper = new BeanPropertyRowMapper<AirSourceMenuVo>(AirSourceMenuVo.class);
+        List<AirSourceMenuVo> list = jdbcTemplate.query(stringBuffer.toString(),rowMapper,map.values().toArray());
+        return list;
+    }
+
     private Integer count(String where, Object[] objects) {
         String sql = "select count(*) from sc_airsource_menu "+ where;
         return jdbcTemplate.queryForObject(sql,Integer.class,objects);

+ 2 - 0
oa_service/src/main/java/com/bjlt/spider/table/service/AirSourceMenuService.java

@@ -14,4 +14,6 @@ public interface AirSourceMenuService {
     void deleteAirSourceMenu(String id);
 
     AirSourceMenuVo selectById(String id);
+
+    List<AirSourceMenuVo> listAirSourceMenu(AirSourceMenuVo airSourceMenuVo);
 }

+ 5 - 0
oa_service/src/main/java/com/bjlt/spider/table/service/impl/AirSourceMenuServiceImpl.java

@@ -56,5 +56,10 @@ public class AirSourceMenuServiceImpl implements AirSourceMenuService{
         return airSourceMenuDao.selectById(id);
     }
 
+    @Override
+    public List<AirSourceMenuVo> listAirSourceMenu(AirSourceMenuVo airSourceMenuVo) {
+        return airSourceMenuDao.listAirSourceMenu(airSourceMenuVo);
+    }
+
 
 }