Commit 29152c5f authored by co_dengxiongwen's avatar co_dengxiongwen

室外气象数据接口调整

parent d53e9fe5
...@@ -57,13 +57,13 @@ public class KanBanController extends AbstractController { ...@@ -57,13 +57,13 @@ public class KanBanController extends AbstractController {
*/ */
@ApiOperation(value="获取室外气象站数据", notes="获取室外气象站数据") @ApiOperation(value="获取室外气象站数据", notes="获取室外气象站数据")
@GetMapping("/getSwqxzInfoTj") @GetMapping("/getSwqxzInfoTj")
public R getSwqxzInfoTj(Integer type) { public R getSwqxzInfoTj(@RequestParam Integer type) {
System.out.println("type:"+ type);
List<SwqxzInfoHour> list = swqxzInfoHourService.getList(type); List<SwqxzInfoHour> list = swqxzInfoHourService.getList(type);
List<List<String>> temperatureList = new ArrayList<List<String>>(); List<List<String>> temperatureList = new ArrayList<List<String>>();
List<List<String>> humidityList = new ArrayList<List<String>>(); List<List<String>> humidityList = new ArrayList<List<String>>();
List<List<String>> windSpeedList = new ArrayList<List<String>>(); List<List<String>> windSpeedList = new ArrayList<List<String>>();
List<List<String>> windDirectionList = new ArrayList<List<String>>();
List<List<String>> illuminanceList = new ArrayList<List<String>>(); List<List<String>> illuminanceList = new ArrayList<List<String>>();
List<List<String>> carbonDioxideList = new ArrayList<List<String>>(); List<List<String>> carbonDioxideList = new ArrayList<List<String>>();
List<List<String>> fineParticlesList = new ArrayList<List<String>>(); List<List<String>> fineParticlesList = new ArrayList<List<String>>();
...@@ -73,7 +73,6 @@ public class KanBanController extends AbstractController { ...@@ -73,7 +73,6 @@ public class KanBanController extends AbstractController {
List<String> temperatureListDetail = new ArrayList<String>(); List<String> temperatureListDetail = new ArrayList<String>();
List<String> humidityListDetail = new ArrayList<String>(); List<String> humidityListDetail = new ArrayList<String>();
List<String> windSpeedListDetail = new ArrayList<String>(); List<String> windSpeedListDetail = new ArrayList<String>();
List<String> windDirectionListDetail = new ArrayList<String>();
List<String> illuminanceListDetail = new ArrayList<String>(); List<String> illuminanceListDetail = new ArrayList<String>();
List<String> carbonDioxideListDetail = new ArrayList<String>(); List<String> carbonDioxideListDetail = new ArrayList<String>();
List<String> fineParticlesListDetail = new ArrayList<String>(); List<String> fineParticlesListDetail = new ArrayList<String>();
...@@ -90,9 +89,6 @@ public class KanBanController extends AbstractController { ...@@ -90,9 +89,6 @@ public class KanBanController extends AbstractController {
windSpeedListDetail.add(time); windSpeedListDetail.add(time);
windSpeedListDetail.add(list.get(i).getWindSpeed()); windSpeedListDetail.add(list.get(i).getWindSpeed());
windDirectionListDetail.add(time);
windDirectionListDetail.add(list.get(i).getWindDirection());
illuminanceListDetail.add(time); illuminanceListDetail.add(time);
illuminanceListDetail.add(list.get(i).getIlluminance()); illuminanceListDetail.add(list.get(i).getIlluminance());
...@@ -108,7 +104,6 @@ public class KanBanController extends AbstractController { ...@@ -108,7 +104,6 @@ public class KanBanController extends AbstractController {
temperatureList.add(temperatureListDetail); temperatureList.add(temperatureListDetail);
humidityList.add(humidityListDetail); humidityList.add(humidityListDetail);
windSpeedList.add(windSpeedListDetail); windSpeedList.add(windSpeedListDetail);
windDirectionList.add(windDirectionListDetail);
illuminanceList.add(illuminanceListDetail); illuminanceList.add(illuminanceListDetail);
carbonDioxideList.add(carbonDioxideListDetail); carbonDioxideList.add(carbonDioxideListDetail);
fineParticlesList.add(fineParticlesListDetail); fineParticlesList.add(fineParticlesListDetail);
...@@ -118,7 +113,6 @@ public class KanBanController extends AbstractController { ...@@ -118,7 +113,6 @@ public class KanBanController extends AbstractController {
return R.ok().put("temperatureList", temperatureList) return R.ok().put("temperatureList", temperatureList)
.put("humidityList", humidityList) .put("humidityList", humidityList)
.put("windSpeedList", windSpeedList) .put("windSpeedList", windSpeedList)
.put("windDirectionList", windDirectionList)
.put("illuminanceList", illuminanceList) .put("illuminanceList", illuminanceList)
.put("carbonDioxideList", carbonDioxideList) .put("carbonDioxideList", carbonDioxideList)
.put("fineParticlesList", fineParticlesList) .put("fineParticlesList", fineParticlesList)
......
package com.devplatform.admin.modules.eq.dao; package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.SnqxzInfoDayModel;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoDay; import com.devplatform.admin.modules.eq.bean.SnqxzInfoDay;
import com.devplatform.admin.modules.eq.model.SnqxzInfoDayModel;
import com.devplatform.common.dao.MyBaseMapper; import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* SnqxzInfoDay Mapper * SnqxzInfoDay Mapper
...@@ -33,12 +29,5 @@ public interface SnqxzInfoDayDao extends MyBaseMapper<SnqxzInfoDay> { ...@@ -33,12 +29,5 @@ public interface SnqxzInfoDayDao extends MyBaseMapper<SnqxzInfoDay> {
*/ */
List<SnqxzInfoDay> queryPageList(SnqxzInfoDayModel model); List<SnqxzInfoDay> queryPageList(SnqxzInfoDayModel model);
/**
* 查询室内气象站信息-天分页数据
* @param page
* @param params
* @return
*/
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
} }
package com.devplatform.admin.modules.eq.dao; package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.common.dao.MyBaseMapper; import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* SnqxzInfoHour Mapper * SnqxzInfoHour Mapper
...@@ -29,4 +32,13 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> { ...@@ -29,4 +32,13 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> {
* @return * @return
*/ */
List<SnqxzInfoHour> queryPageList(SnqxzInfoHourModel model); List<SnqxzInfoHour> queryPageList(SnqxzInfoHourModel model);
/**
* 查询室内气象站信息-天分页数据
* @param page
* @param params
* @return
*/
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
} }
...@@ -33,12 +33,4 @@ public interface SwqxzInfoDayDao extends MyBaseMapper<SwqxzInfoDay> { ...@@ -33,12 +33,4 @@ public interface SwqxzInfoDayDao extends MyBaseMapper<SwqxzInfoDay> {
*/ */
List<SwqxzInfoDay> queryPageList(SwqxzInfoDayModel model); List<SwqxzInfoDay> queryPageList(SwqxzInfoDayModel model);
/**
* 查询室外气象站信息-天分页数据
* @param page
* @param params
* @return
*/
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
} }
package com.devplatform.admin.modules.eq.dao; package com.devplatform.admin.modules.eq.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.common.dao.MyBaseMapper; import com.devplatform.common.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* SwqxzInfoHour Mapper * SwqxzInfoHour Mapper
...@@ -30,5 +33,15 @@ public interface SwqxzInfoHourDao extends MyBaseMapper<SwqxzInfoHour> { ...@@ -30,5 +33,15 @@ public interface SwqxzInfoHourDao extends MyBaseMapper<SwqxzInfoHour> {
*/ */
List<SwqxzInfoHour> queryPageList(SwqxzInfoHourModel model); List<SwqxzInfoHour> queryPageList(SwqxzInfoHourModel model);
List<SwqxzInfoHour> getList(Integer type); List<SwqxzInfoHour> getList(@Param("type")Integer type);
/**
* 查询室外气象站信息-时分页数据
* @param page
* @param params
* @return
*/
Page<Map<String, Object>> queryPageListByParam(@Param("page") Page<Map<String, Object>> page,
@Param("params") Map<String, Object> params);
} }
...@@ -24,10 +24,4 @@ public interface SnqxzInfoDayService extends MyBaseService<SnqxzInfoDay> { ...@@ -24,10 +24,4 @@ public interface SnqxzInfoDayService extends MyBaseService<SnqxzInfoDay> {
*/ */
List<SnqxzInfoDay> queryPageList(SnqxzInfoDayModel model); List<SnqxzInfoDay> queryPageList(SnqxzInfoDayModel model);
/**
* 查询室内气象站信息-天分页数据
* @param params
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
} }
package com.devplatform.admin.modules.eq.service; package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.common.service.MyBaseService; import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 室内气象站信息-时的service接口 * 室内气象站信息-时的service接口
...@@ -22,5 +24,10 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> { ...@@ -22,5 +24,10 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> {
*/ */
List<SnqxzInfoHour> queryPageList(SnqxzInfoHourModel model); List<SnqxzInfoHour> queryPageList(SnqxzInfoHourModel model);
/**
* 查询室内气象站信息-时分页数据
* @param params
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
} }
...@@ -23,11 +23,4 @@ public interface SwqxzInfoDayService extends MyBaseService<SwqxzInfoDay> { ...@@ -23,11 +23,4 @@ public interface SwqxzInfoDayService extends MyBaseService<SwqxzInfoDay> {
* @return * @return
*/ */
List<SwqxzInfoDay> queryPageList(SwqxzInfoDayModel model); List<SwqxzInfoDay> queryPageList(SwqxzInfoDayModel model);
/**
* 查询室外气象站信息-天分页数据
* @param params
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
} }
package com.devplatform.admin.modules.eq.service; package com.devplatform.admin.modules.eq.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.common.service.MyBaseService; import com.devplatform.common.service.MyBaseService;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 室外气象站信息-时的service接口 * 室外气象站信息-时的service接口
...@@ -24,4 +26,11 @@ public interface SwqxzInfoHourService extends MyBaseService<SwqxzInfoHour> { ...@@ -24,4 +26,11 @@ public interface SwqxzInfoHourService extends MyBaseService<SwqxzInfoHour> {
List<SwqxzInfoHour> getList(Integer type); List<SwqxzInfoHour> getList(Integer type);
/**
* 查询室外气象站信息-时分页数据
* @param params
* @return
*/
Page<Map<String,Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params);
} }
...@@ -23,17 +23,17 @@ public class KanBanServiceImpl implements KanBanService { ...@@ -23,17 +23,17 @@ public class KanBanServiceImpl implements KanBanService {
@Autowired @Autowired
private PfjInfoDayService pfjInfoDayService; private PfjInfoDayService pfjInfoDayService;
@Autowired @Autowired
private SnqxzInfoDayService snqxzInfoDayService; private SnqxzInfoHourService snqxzInfoHourService;
@Autowired @Autowired
private SwqxzInfoDayService swqxzInfoDayService; private SwqxzInfoHourService swqxzInfoHourService;
@Override @Override
public Page<Map<String,Object>> getListByTypeAndId(Map<String, Object> params) { public Page<Map<String,Object>> getListByTypeAndId(Map<String, Object> params) {
Page<Map<String,Object>> list = new Page<Map<String,Object>>(); Page<Map<String,Object>> list = new Page<Map<String,Object>>();
Integer page = (Integer) params.get("page"); String page = (String) params.get("page");
Integer rows = (Integer) params.get("rows"); String rows = (String) params.get("rows");
String resourceType = (String) params.get("resourceType"); String resourceType = (String) params.get("resourceType");
Page<Map<String,Object>> pageTask = new Page<Map<String, Object>>(page, rows); Page<Map<String,Object>> pageTask = new Page<Map<String, Object>>(Integer.valueOf(page), Integer.valueOf(rows));
if(Constants.ID_PFJ.equals(resourceType)){ if(Constants.ID_PFJ.equals(resourceType)){
list = pfjInfoDayService.queryPageListByParam(pageTask,params); list = pfjInfoDayService.queryPageListByParam(pageTask,params);
...@@ -50,13 +50,13 @@ public class KanBanServiceImpl implements KanBanService { ...@@ -50,13 +50,13 @@ public class KanBanServiceImpl implements KanBanService {
}else if(Constants.ID_SB.equals(resourceType)){ }else if(Constants.ID_SB.equals(resourceType)){
}else if(Constants.ID_SWQXZ.equals(resourceType)){ }else if(Constants.ID_SWQXZ.equals(resourceType)){
list = swqxzInfoDayService.queryPageListByParam(pageTask,params); list = swqxzInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_DLSNJ.equals(resourceType)){ }else if(Constants.ID_DLSNJ.equals(resourceType)){
}else if(Constants.ID_SLSWJ.equals(resourceType)){ }else if(Constants.ID_SLSWJ.equals(resourceType)){
}else if(Constants.ID_SNQXZ.equals(resourceType)){ }else if(Constants.ID_SNQXZ.equals(resourceType)){
list = snqxzInfoDayService.queryPageListByParam(pageTask,params); list = snqxzInfoHourService.queryPageListByParam(pageTask,params);
}else if(Constants.ID_HQS.equals(resourceType)){ }else if(Constants.ID_HQS.equals(resourceType)){
} }
......
package com.devplatform.admin.modules.eq.service.impl; package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoDay; import com.devplatform.admin.modules.eq.bean.SnqxzInfoDay;
import com.devplatform.admin.modules.eq.dao.SnqxzInfoDayDao; import com.devplatform.admin.modules.eq.dao.SnqxzInfoDayDao;
import com.devplatform.admin.modules.eq.model.SnqxzInfoDayModel; import com.devplatform.admin.modules.eq.model.SnqxzInfoDayModel;
...@@ -9,7 +8,6 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl; ...@@ -9,7 +8,6 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 室内气象站信息-天的service接口实现类 * 室内气象站信息-天的service接口实现类
...@@ -27,8 +25,4 @@ public class SnqxzInfoDayServiceImpl extends MyBaseServiceImpl<SnqxzInfoDayDao, ...@@ -27,8 +25,4 @@ public class SnqxzInfoDayServiceImpl extends MyBaseServiceImpl<SnqxzInfoDayDao,
return baseMapper.queryPageList(model); return baseMapper.queryPageList(model);
} }
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
} }
package com.devplatform.admin.modules.eq.service.impl; package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SnqxzInfoHour;
import com.devplatform.admin.modules.eq.dao.SnqxzInfoHourDao; import com.devplatform.admin.modules.eq.dao.SnqxzInfoHourDao;
import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SnqxzInfoHourModel;
...@@ -8,6 +9,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl; ...@@ -8,6 +9,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 室内气象站信息-时的service接口实现类 * 室内气象站信息-时的service接口实现类
...@@ -24,5 +26,8 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao ...@@ -24,5 +26,8 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao
model.getPager().setRowCount(rowCount); model.getPager().setRowCount(rowCount);
return baseMapper.queryPageList(model); return baseMapper.queryPageList(model);
} }
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
} }
...@@ -30,8 +30,4 @@ public class SwqxzInfoDayServiceImpl extends MyBaseServiceImpl<SwqxzInfoDayDao, ...@@ -30,8 +30,4 @@ public class SwqxzInfoDayServiceImpl extends MyBaseServiceImpl<SwqxzInfoDayDao,
return baseMapper.queryPageList(model); return baseMapper.queryPageList(model);
} }
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
} }
package com.devplatform.admin.modules.eq.service.impl; package com.devplatform.admin.modules.eq.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour; import com.devplatform.admin.modules.eq.bean.SwqxzInfoHour;
import com.devplatform.admin.modules.eq.dao.SwqxzInfoHourDao; import com.devplatform.admin.modules.eq.dao.SwqxzInfoHourDao;
import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel; import com.devplatform.admin.modules.eq.model.SwqxzInfoHourModel;
...@@ -8,6 +9,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl; ...@@ -8,6 +9,7 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 室外气象站信息-时的service接口实现类 * 室外气象站信息-时的service接口实现类
...@@ -30,4 +32,9 @@ public class SwqxzInfoHourServiceImpl extends MyBaseServiceImpl<SwqxzInfoHourDao ...@@ -30,4 +32,9 @@ public class SwqxzInfoHourServiceImpl extends MyBaseServiceImpl<SwqxzInfoHourDao
return baseMapper.getList(type); return baseMapper.getList(type);
} }
@Override
public Page<Map<String, Object>> queryPageListByParam(Page<Map<String, Object>> page, Map<String, Object> params) {
return baseMapper.queryPageListByParam(page,params);
}
} }
...@@ -47,25 +47,6 @@ ...@@ -47,25 +47,6 @@
</if> </if>
</select> </select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from snqxz_info_day t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
</if>
</select>
</mapper> </mapper>
...@@ -47,6 +47,32 @@ ...@@ -47,6 +47,32 @@
</if> </if>
</select> </select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from snqxz_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1);
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.type == 4">
and DATE_FORMAT(t.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
</if>
</select>
</mapper> </mapper>
...@@ -57,25 +57,7 @@ ...@@ -57,25 +57,7 @@
</if> </if>
</select> </select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from swqxz_info_day t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.startTime != null and params.startTime != ''">
and t.create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime != ''">
and t.create_time &lt;= #{params.endTime}
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
</if>
</select>
</mapper> </mapper>
...@@ -63,17 +63,43 @@ ...@@ -63,17 +63,43 @@
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
<if test="type == 2"> <if test="type == 2">
and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1); and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if> </if>
<if test="type == 3"> <if test="type == 3">
and DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and DATE_FORMAT(create_time,'%Y%m')=DATE_FORMAT(CURDATE(), '%Y%m' )
</if> </if>
<if test="type == 4"> <if test="type == 4">
and DATE_FORMAT( create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) and DATE_FORMAT( create_time, '%Y' ) = DATE_FORMAT( CURDATE() , '%Y' )
</if> </if>
order by create_time order by create_time
</select> </select>
<select id="queryPageListByParam" resultType="java.util.Map">
select t.* from swqxz_info_hour t
where 1=1
<if test="params.resourceId!=null and params.resourceId!=''">
and t.resource_id = #{params.resourceId}
</if>
<if test="params.type == 1">
and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if>
<if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.type == 4">
and DATE_FORMAT(t.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
</if>
<if test="params.sort != null and params.sort != '' and params.order != null and params.order != ''">
ORDER BY ${params.sort} ${params.order}
</if>
<if test="params.sort == null or params.sort == '' or params.order == null or params.order == ''">
ORDER BY t.create_time DESC
</if>
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment