|
@@ -34,7 +34,7 @@ public class AirSourceMenuDaoImpl implements AirSourceMenuDao {
|
|
@Override
|
|
@Override
|
|
public List<AirSourceMenuVo> listPageAirSourceMenu(AirSourceMenuVo airSourceMenuVo){
|
|
public List<AirSourceMenuVo> listPageAirSourceMenu(AirSourceMenuVo airSourceMenuVo){
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
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);
|
|
stringBuffer.append(select);
|
|
Map<String,Object> map = map(airSourceMenuVo);
|
|
Map<String,Object> map = map(airSourceMenuVo);
|
|
String where = " where 1 = 1 " + map.keySet().stream().map(t -> " and " + t + "=?").collect(Collectors.joining(" "));
|
|
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;
|
|
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) {
|
|
private Integer count(String where, Object[] objects) {
|
|
String sql = "select count(*) from sc_airsource_menu "+ where;
|
|
String sql = "select count(*) from sc_airsource_menu "+ where;
|
|
return jdbcTemplate.queryForObject(sql,Integer.class,objects);
|
|
return jdbcTemplate.queryForObject(sql,Integer.class,objects);
|