forked from xxhjsb/wit-park-backend
统计接口提交
parent
3d88cfe508
commit
0e80d87d82
|
@ -86,4 +86,13 @@ public class HazardousOperationController extends BaseController {
|
||||||
public String hazardousOperationManagement() {
|
public String hazardousOperationManagement() {
|
||||||
return hazardousOperationService.hazardousOperationManagement();
|
return hazardousOperationService.hazardousOperationManagement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行中/已备案作业数量变化趋势图
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/hazardousOperationVariationTendency")
|
||||||
|
public String hazardousOperationVariationTendency() {
|
||||||
|
return hazardousOperationService.hazardousOperationVariationTendency();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ public class RiskController extends BaseController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 风险项每周数量统计
|
* 风险项每周数量统计
|
||||||
|
* 统计当前时间往前推一年的周数
|
||||||
*/
|
*/
|
||||||
@GetMapping("/weeklyQuantityStatistics")
|
@GetMapping("/weeklyQuantityStatistics")
|
||||||
public String weeklyQuantityStatistics() {
|
public String weeklyQuantityStatistics() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hbt.safety.supervision.mapper;
|
package com.hbt.safety.supervision.mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbt.safety.supervision.pojo.HazardousOperation;
|
import com.hbt.safety.supervision.pojo.HazardousOperation;
|
||||||
|
@ -71,4 +72,12 @@ public interface HazardousOperationMapper
|
||||||
* @return 危险作业管理信息
|
* @return 危险作业管理信息
|
||||||
*/
|
*/
|
||||||
List<HazardousOperation> hazardousOperationManagement();
|
List<HazardousOperation> hazardousOperationManagement();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行中/已备案作业数量变化趋势图
|
||||||
|
*
|
||||||
|
* @param yearAgo 当前时间往前推一年的时间
|
||||||
|
* @return 返回值
|
||||||
|
*/
|
||||||
|
List<Date> hazardousOperationVariationTendency(Date yearAgo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hbt.safety.supervision.mapper;
|
package com.hbt.safety.supervision.mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbt.safety.supervision.pojo.HiddenDanger;
|
import com.hbt.safety.supervision.pojo.HiddenDanger;
|
||||||
|
@ -68,8 +69,8 @@ public interface HiddenDangerMapper
|
||||||
/**
|
/**
|
||||||
* 查询所有上报时间对应的周数
|
* 查询所有上报时间对应的周数
|
||||||
*
|
*
|
||||||
* @param year 当前年份
|
* @param yearAgo 当前时间往前推一年的时间
|
||||||
* @return 返回值
|
* @return 返回值
|
||||||
*/
|
*/
|
||||||
List<Integer> selectHiddenDangerSubmitDats(int year);
|
List<Date> selectHiddenDangerSubmitDats(Date yearAgo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,9 +81,9 @@ public interface RiskMapper
|
||||||
/**
|
/**
|
||||||
* 查询所有上报时间对应的周数
|
* 查询所有上报时间对应的周数
|
||||||
*
|
*
|
||||||
* @param year 当前年份
|
* @param yearAgo 一年前的时间
|
||||||
* @return 返回值
|
* @return 返回值
|
||||||
*/
|
*/
|
||||||
List<Integer> selectRiskSubmitDats(int year);
|
List<Date> selectRiskSubmitDats(Date yearAgo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.hbt.safety.supervision.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周统计数据实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WeekDateVo {
|
||||||
|
|
||||||
|
private int week; // 周数
|
||||||
|
|
||||||
|
private int count; // 数量
|
||||||
|
}
|
|
@ -60,7 +60,20 @@ public interface IHazardousOperationService
|
||||||
*/
|
*/
|
||||||
int deleteHazardousOperationById(int id);
|
int deleteHazardousOperationById(int id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页危险作业统计
|
||||||
|
*
|
||||||
|
* @return 返回值
|
||||||
|
*/
|
||||||
String hazardousOperationStatistics();
|
String hazardousOperationStatistics();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 危险作业统计
|
||||||
|
*/
|
||||||
String hazardousOperationManagement();
|
String hazardousOperationManagement();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行中/已备案作业数量变化趋势图
|
||||||
|
*/
|
||||||
|
String hazardousOperationVariationTendency();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,16 @@ import java.util.stream.Collectors;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hbt.safety.supervision.pojo.HazardousOperation;
|
import com.hbt.safety.supervision.pojo.HazardousOperation;
|
||||||
import com.hbt.safety.supervision.pojo.vo.StatisticsVo;
|
import com.hbt.safety.supervision.pojo.vo.StatisticsVo;
|
||||||
|
import com.hbt.safety.supervision.pojo.vo.WeekDateVo;
|
||||||
|
import com.hbt.safety.supervision.util.YearWeeksUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.hbt.safety.supervision.mapper.HazardousOperationMapper;
|
import com.hbt.safety.supervision.mapper.HazardousOperationMapper;
|
||||||
import com.hbt.safety.supervision.service.IHazardousOperationService;
|
import com.hbt.safety.supervision.service.IHazardousOperationService;
|
||||||
|
|
||||||
|
import static com.hbt.safety.supervision.util.YearWeeksUtil.getYearWeekConut;
|
||||||
|
import static com.hbt.safety.supervision.util.YearWeeksUtil.weekBetweenYearAgoDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 危险作业Service业务层处理
|
* 危险作业Service业务层处理
|
||||||
*
|
*
|
||||||
|
@ -149,6 +154,9 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
|
||||||
return JSONObject.toJSONString(map);
|
return JSONObject.toJSONString(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 危险作业统计
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String hazardousOperationManagement() {
|
public String hazardousOperationManagement() {
|
||||||
// 获取当前时间
|
// 获取当前时间
|
||||||
|
@ -180,4 +188,41 @@ public class HazardousOperationServiceImpl implements IHazardousOperationService
|
||||||
map.put("historyHazardousOperation", historyHazardousOperation);
|
map.put("historyHazardousOperation", historyHazardousOperation);
|
||||||
return JSONObject.toJSONString(map);
|
return JSONObject.toJSONString(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行中/已备案作业数量变化趋势图
|
||||||
|
* 说明:危险作业结束时间大于等于当前周的作业,即为进行中、待开始的作业
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String hazardousOperationVariationTendency() {
|
||||||
|
// 获取当前时间往前推一年的时间
|
||||||
|
Date yearAgo = YearWeeksUtil.getyearAgoDate();
|
||||||
|
// 获取当前时间及往前推一年的危险作业开始结束时间
|
||||||
|
List<Date> list = hazardousOperationMapper.hazardousOperationVariationTendency(yearAgo);
|
||||||
|
|
||||||
|
List<Integer> operationWeekList = new ArrayList<>();
|
||||||
|
// 遍历危险作业,计算每个时间的周数
|
||||||
|
for (Date date : list) {;
|
||||||
|
// 计算上报风险危险作业结束时间,与一年前时间间的周数
|
||||||
|
int endWeek = weekBetweenYearAgoDate(date);
|
||||||
|
operationWeekList.add(endWeek);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前时间和往前推一年间的周数
|
||||||
|
int weeks = getYearWeekConut();
|
||||||
|
|
||||||
|
List<WeekDateVo> weekDates = new ArrayList<>();
|
||||||
|
// 筛选数据
|
||||||
|
for (int i = 1; i <= weeks; i++) {
|
||||||
|
WeekDateVo weekDateVo = new WeekDateVo();
|
||||||
|
int finalI = i;
|
||||||
|
// 筛选 当前作业结束时间大于等于当前周的作业,即为进行中、待开始的作业
|
||||||
|
int count = (int) operationWeekList.stream().filter(s -> finalI <= s).count();
|
||||||
|
weekDateVo.setWeek(i);
|
||||||
|
weekDateVo.setCount(count);
|
||||||
|
weekDates.add(weekDateVo);
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
return JSONObject.toJSONString(weekDates);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package com.hbt.safety.supervision.service.impl;
|
package com.hbt.safety.supervision.service.impl;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
@ -137,10 +135,13 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService
|
||||||
* @return 返回值
|
* @return 返回值
|
||||||
*/
|
*/
|
||||||
public String hiddenDangerWeeklyStatistics() {
|
public String hiddenDangerWeeklyStatistics() {
|
||||||
// 获取当前年份
|
|
||||||
int year = YearWeeksUtil.getCurrentYear();
|
// 获取当前时间往前推一年的时间
|
||||||
List<Integer> list = hiddenDangerMapper.selectHiddenDangerSubmitDats(year);
|
Date yearAgo = YearWeeksUtil.getyearAgoDate();
|
||||||
// 处理数据
|
|
||||||
return YearWeeksUtil.dealWeekDate(list, year);
|
// 获取当前时间及往前推一年的风险时间
|
||||||
|
List<Date> list = hiddenDangerMapper.selectHiddenDangerSubmitDats(yearAgo);
|
||||||
|
|
||||||
|
return YearWeeksUtil.dealWeekDate(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package com.hbt.safety.supervision.service.impl;
|
package com.hbt.safety.supervision.service.impl;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hbt.safety.supervision.mapper.RiskMapper;
|
import com.hbt.safety.supervision.mapper.RiskMapper;
|
||||||
import com.hbt.safety.supervision.pojo.Risk;
|
import com.hbt.safety.supervision.pojo.Risk;
|
||||||
|
@ -119,10 +115,12 @@ public class RiskServiceImpl implements IRiskService
|
||||||
* 风险项每周数量统计
|
* 风险项每周数量统计
|
||||||
*/
|
*/
|
||||||
public String weeklyQuantityStatistics() {
|
public String weeklyQuantityStatistics() {
|
||||||
// 获取当前年份
|
// 获取当前时间往前推一年的时间
|
||||||
int year = YearWeeksUtil.getCurrentYear();
|
Date yearAgo = YearWeeksUtil.getyearAgoDate();
|
||||||
List<Integer> list = riskMapper.selectRiskSubmitDats(year);
|
|
||||||
// 处理数据
|
// 获取当前时间及往前推一年的风险时间
|
||||||
return YearWeeksUtil.dealWeekDate(list, year);
|
List<Date> list = riskMapper.selectRiskSubmitDats(yearAgo);
|
||||||
|
|
||||||
|
return YearWeeksUtil.dealWeekDate(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package com.hbt.safety.supervision.util;
|
package com.hbt.safety.supervision.util;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.springframework.util.CollectionUtils;
|
import com.hbt.safety.supervision.pojo.vo.WeekDateVo;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时间工具类
|
* 时间工具类
|
||||||
|
@ -19,73 +18,115 @@ public class YearWeeksUtil {
|
||||||
*/
|
*/
|
||||||
public static int getCurrentYear() {
|
public static int getCurrentYear() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
int weekYear = calendar.get(Calendar.YEAR);//获得当前的年
|
return calendar.get(Calendar.YEAR);
|
||||||
return weekYear;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取某年某周的时间跨度
|
|
||||||
* @param year
|
|
||||||
* @param week
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Map<String, String> getWeekRangeMap(int year, int week) {
|
|
||||||
Map<String, String> timeMap = new HashMap<>();
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.set(Calendar.YEAR,year);
|
|
||||||
calendar.setFirstDayOfWeek(Calendar.MONDAY);//设置星期一为一周开始的第一天
|
|
||||||
calendar.setMinimalDaysInFirstWeek(4);//可以不用设置
|
|
||||||
int weekYear = calendar.get(Calendar.YEAR);//获得当前的年
|
|
||||||
calendar.setWeekDate(weekYear, week, 2);//获得指定年的第几周的开始日期
|
|
||||||
Date time=calendar.getTime();
|
|
||||||
String startTime = new SimpleDateFormat("yyyy-MM-dd").format(time)+" 00:00:00";
|
|
||||||
timeMap.put("startTime",startTime);
|
|
||||||
calendar.setWeekDate(weekYear, week, 1);//获得指定年的第几周的结束日期
|
|
||||||
time=calendar.getTime();
|
|
||||||
String endTime = new SimpleDateFormat("yyyy-MM-dd").format(time)+" 23:59:59";
|
|
||||||
timeMap.put("endTime",endTime);
|
|
||||||
return timeMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某年有多少周
|
* 计算当前时间往前推一年的周数
|
||||||
*
|
*
|
||||||
* @param year 年份
|
* @return 周数
|
||||||
* @return 一年的周数
|
|
||||||
* @throws ParseException
|
|
||||||
*/
|
*/
|
||||||
public static int getYearWeekConut(int year){
|
public static int getYearWeekConut() {
|
||||||
int week = 52;
|
// 获取当前时间
|
||||||
|
Date nowDate = getNowDate();
|
||||||
|
// 获取当前时间 往前推一年的时间
|
||||||
|
Date yearAgo = getyearAgoDate();
|
||||||
|
// 计算两个时间之间的天数
|
||||||
|
return weekBetween(yearAgo, nowDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算一年前的时间和指定时间之前的周数
|
||||||
|
*
|
||||||
|
* @param date 指定时间
|
||||||
|
* @return 周数
|
||||||
|
*/
|
||||||
|
public static int weekBetweenYearAgoDate(Date date) {
|
||||||
|
// 获取一年前的时间
|
||||||
|
Date yearAgo = getyearAgoDate();
|
||||||
|
// 获取周数
|
||||||
|
return weekBetween(yearAgo, date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间
|
||||||
|
*
|
||||||
|
* @return 当前时间
|
||||||
|
*/
|
||||||
|
private static Date getNowDate () {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(new Date());
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间 往前推一年的时间
|
||||||
|
*
|
||||||
|
* @return 时间
|
||||||
|
*/
|
||||||
|
public static Date getyearAgoDate () {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.add(Calendar.YEAR, -1);
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取两个日期间的周数,精确到年月日
|
||||||
|
*
|
||||||
|
* @param start 开始时间
|
||||||
|
* @param end 结束时间
|
||||||
|
* @return 周数
|
||||||
|
*/
|
||||||
|
private static int weekBetween(Date start, Date end) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
try {
|
try {
|
||||||
Map<String, String> timeMap = getWeekRangeMap(year,53);
|
start = sdf.parse(sdf.format(start));
|
||||||
if(!CollectionUtils.isEmpty(timeMap)){
|
end = sdf.parse(sdf.format(end));
|
||||||
String startTime = timeMap.get("startTime");
|
} catch (ParseException e) {
|
||||||
if(startTime.substring(0, 4).equals(year+"")){ //判断年度是否相符,如果相符说明有53个周。
|
|
||||||
week = 53;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
long startTime = start.getTime();
|
||||||
|
long endTime = end.getTime();
|
||||||
|
long betweenDays = (endTime - startTime) / (1000 * 3600 * 24);
|
||||||
|
int days = Integer.parseInt(String.valueOf(betweenDays));
|
||||||
|
int week;
|
||||||
|
if (days % 7 == 0) {
|
||||||
|
week = days / 7;
|
||||||
|
} else {
|
||||||
|
week = (days / 7) + 1;
|
||||||
|
}
|
||||||
return week;
|
return week;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String dealWeekDate(List<Integer> list, int year) {
|
/**
|
||||||
Map<Object, List<Integer>> weekList = new HashMap<>();
|
* 处理数据
|
||||||
if (list != null) {
|
*
|
||||||
weekList = list.stream().collect(Collectors.groupingBy(s -> s));
|
* @param list 数据
|
||||||
|
* @return 返回值
|
||||||
|
*/
|
||||||
|
public static String dealWeekDate(List<Date> list) {
|
||||||
|
List<Integer> weekList = new ArrayList<>();
|
||||||
|
// 遍历风险时间,计算每个时间的周数
|
||||||
|
for (Date date : list) {
|
||||||
|
// 计算上报风险时间,与一年前时间间的周数
|
||||||
|
int week = weekBetweenYearAgoDate(date);
|
||||||
|
weekList.add(week);
|
||||||
}
|
}
|
||||||
Map<Integer, Integer> weekStatistics = new HashMap<>();
|
|
||||||
// 获取当前年份周数
|
// 获取当前时间和往前推一年间的周数
|
||||||
int week = YearWeeksUtil.getYearWeekConut(year);
|
int weeks = getYearWeekConut();
|
||||||
for (int i = 1; i <= week; i++) {
|
|
||||||
if (weekList.containsKey(i)) {
|
List<WeekDateVo> weekDates = new ArrayList<>();
|
||||||
weekStatistics.put(i, weekList.get(i).size());
|
// 筛选数据
|
||||||
} else {
|
for (int i = 1; i <= weeks; i++) {
|
||||||
weekStatistics.put(i, 0);
|
WeekDateVo weekDateVo = new WeekDateVo();
|
||||||
}
|
int finalI = i;
|
||||||
|
int count = (int) weekList.stream().filter(s -> s == finalI).count();
|
||||||
|
weekDateVo.setWeek(i);
|
||||||
|
weekDateVo.setCount(count);
|
||||||
|
weekDates.add(weekDateVo);
|
||||||
}
|
}
|
||||||
return JSONObject.toJSONString(weekStatistics);
|
// 处理数据
|
||||||
|
return JSONObject.toJSONString(weekDates);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -103,4 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="hazardousOperationManagement" resultType="HazardousOperation">
|
<select id="hazardousOperationManagement" resultType="HazardousOperation">
|
||||||
select name,operation_start operationStart ,operation_end operationEnd from hazardous_operation
|
select name,operation_start operationStart ,operation_end operationEnd from hazardous_operation
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="hazardousOperationVariationTendency" resultType="java.util.Date">
|
||||||
|
select operation_end from hazardous_operation where DATE_FORMAT(operation_start,'%Y-%m-%d') >= DATE_FORMAT(#{yearAgo},'%Y-%m-%d')
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select name, reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0
|
select name, reform_status reformStatus from hidden_danger where exceed_time_limit_status = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectHiddenDangerSubmitDats" resultType="Integer">
|
<select id="selectHiddenDangerSubmitDats" resultType="java.util.Date">
|
||||||
select WEEK(submit_date, 1) + 1 from hidden_danger where YEAR(submit_date) = #{year}
|
select submit_date from hidden_danger where DATE_FORMAT(submit_date,'%Y-%m-%d') >= DATE_FORMAT(#{yearAgo},'%Y-%m-%d')
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select name, level from risk
|
select name, level from risk
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRiskSubmitDats" resultType="Integer">
|
<select id="selectRiskSubmitDats" resultType="java.util.Date">
|
||||||
select WEEK(submit_date, 1) + 1 from risk where YEAR(submit_date) = #{year}
|
select submit_date from risk where DATE_FORMAT(submit_date,'%Y-%m-%d') >= DATE_FORMAT(#{yearAgo},'%Y-%m-%d')
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue