Merge branch 'develop_master' into FOTON

This commit is contained in:
super_liu
2022-01-25 20:15:57 +08:00
10 changed files with 440 additions and 29 deletions
@@ -14,7 +14,7 @@ public class TableToExcel {
public static <T extends Object> Workbook createExcel(Map<String,String> columnMap, List<T> dataList, String sheelName, String fileName) {
if(sheelName==null)sheelName="sheet1";
columnMap.put("a","序号");
int sheetRow=500;
sheetRow=sheetRow<0?200:sheetRow;
//第一步,创建一个webbook,对应一个excel文件,内存中sheetRow条记录后提交。
@@ -36,9 +36,10 @@ public class TableToExcel {
Row neckRow = sheet.createRow(1);
sheet.addMergedRegion(new CellRangeAddress(0,1,0,0));
sheet.addMergedRegion(new CellRangeAddress(0,1,1,1));
sheet.addMergedRegion(new CellRangeAddress(0,0,2,4));
sheet.addMergedRegion(new CellRangeAddress(0,1,5,5));
sheet.addMergedRegion(new CellRangeAddress(0,1,2,2));
sheet.addMergedRegion(new CellRangeAddress(0,0,3,5));
sheet.addMergedRegion(new CellRangeAddress(0,1,6,6));
sheet.addMergedRegion(new CellRangeAddress(0,1,9,9));
sheet.addMergedRegion(new CellRangeAddress(0,1,7,7));
sheet.addMergedRegion(new CellRangeAddress(0,1,8,8));
//生成表头行
@@ -46,39 +47,51 @@ public class TableToExcel {
for(String key:keys) {
Cell hCell=headRow.createCell(j++);
if (j<3)
if (j<4)
hCell.setCellValue(columnMap.get(key));
}
if (null!=columnMap.get("commentText")) {
Cell hCellh = headRow.createCell(2);
Cell hCellh = headRow.createCell(3);
hCellh.setCellValue("修改意见内容");
}
if (null!=columnMap.get("a")) {
Cell hCellh = headRow.createCell(0);
hCellh.setCellValue("序号");
}
if (null!=columnMap.get("chapterNumber")) {
Cell hCellh = headRow.createCell(1);
hCellh.setCellValue("章条编号");
}
if (null!=columnMap.get("chapterName")) {
Cell hCellh = headRow.createCell(2);
hCellh.setCellValue("章节名称");
}
if (null!=columnMap.get("department")) {
Cell hCell = headRow.createCell(5);
Cell hCell = headRow.createCell(6);
hCell.setCellValue("提出部门");
}
if (null!=columnMap.get("responUserName")) {
Cell hCell1 = headRow.createCell(6);
Cell hCell1 = headRow.createCell(7);
hCell1.setCellValue("提出人");
}
if (null!=columnMap.get("stateText")) {
Cell hCell2 = headRow.createCell(7);
Cell hCell2 = headRow.createCell(8);
hCell2.setCellValue("处理意见");
}
if (null!=columnMap.get("oldText")) {
Cell nCell = neckRow.createCell(2);
Cell nCell = neckRow.createCell(3);
nCell.setCellValue("修改前");
}
if (null!=columnMap.get("newText")) {
Cell nCell1 = neckRow.createCell(3);
Cell nCell1 = neckRow.createCell(4);
nCell1.setCellValue("修改后");
}
if (null!=columnMap.get("reason")) {
Cell nCell1 = neckRow.createCell(4);
Cell nCell1 = neckRow.createCell(5);
nCell1.setCellValue("修改理由");
}
if (null!=columnMap.get("cause")) {
Cell nCell1 = headRow.createCell(8);
Cell nCell1 = headRow.createCell(9);
nCell1.setCellValue("原因");
}
@@ -89,7 +102,8 @@ public class TableToExcel {
T t=dataList.get(k);
Row dataRow=sheet.createRow(c++);
//循环取值进行数据填充
int v=0;
int v=1;
dataRow.createCell(0).setCellValue(k+1);
for(String key:keys) {
if (!"commentText".equals(key)) {
try {
@@ -22,6 +22,8 @@ import java.util.List;
@Repository
public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
List<SarBussionessStand> queryByBussStateSync(SarBussionessStand sarBussionessStand);
SarBussionessStand getStandInfoByReviseStatus(String reviseStatus);
SarBussionessStand selectByPrimaryKey(String standId);
@@ -219,6 +219,17 @@ public class SarBussionessStand extends BaseEntity {
@TableField(exist = false)
private List<SarStandAttrDetailsEO> attrInfoList = new ArrayList<>();
/**
* 新增条件字段
* @return
*/
@TableField(exist = false)
private String reviewTime;
@TableField(exist = false)
private String issueTimeStart;
@TableField(exist = false)
private String issueTimeEnd;
public static long getSerialVersionUID() {
return serialVersionUID;
}
@@ -5,7 +5,9 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -30,7 +32,7 @@ public class SarBussionessStandState extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键/企业标准信息主键")
@TableField("ID")
@TableId(value = "ID", type = IdType.UUID)
private String id;
@ApiModelProperty(value = "企标ID")
@@ -47,11 +49,13 @@ public class SarBussionessStandState extends BaseEntity {
@ApiModelProperty(value = "复审时间")
@TableField("REVIEW_TIME")
private Date reviewTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String reviewTime;
@ApiModelProperty(value = "发布日期")
@TableField("ISSUE_TIME")
private Date issueTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTime;
@ApiModelProperty(value = "复审结果 1 修订、2 废止、3 继续有效")
@TableField("REVIEW_RESULTS")
@@ -63,11 +67,13 @@ public class SarBussionessStandState extends BaseEntity {
@ApiModelProperty(value = "创建日期")
@TableField("CREATION_TIME")
private Date creationTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private String creationTime;
@ApiModelProperty(value = "更新日期")
@TableField("MODIFY_TIME")
private Date modifyTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private String modifyTime;
@TableField("VALID_FLAG")
private Integer validFlag;
@@ -0,0 +1,257 @@
package com.adc.da.slrs.sarBussionessStandState.sync;
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStandState.entity.SarBussionessStandState;
import com.adc.da.slrs.sarBussionessStandState.service.ISarBussionessStandStateService;
import com.adc.da.util.DateUtils;
import com.adc.da.utils.util.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: TODO
* @author: super_liu
* @date: 2022年01月25日 3:34
*/
@EnableScheduling
@Component
@Slf4j
public class StateSync {
Logger logger = LoggerFactory.getLogger(StateSync.class);
@Autowired
private SarBussionessStandDao sarBussionessStandDao;
@Autowired
private ISarBussionessStandStateService bussionessStandStateService;
/**
* 根据配置文件设置是否开启定时器
*/
@Value("${isNotScheduled}")
private boolean isNotScheduled; //是否开启定时器
// 月初
@Scheduled(cron="0 0 1 1 * ?")
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void StandScheduledJobMonthBegin(){
if(isNotScheduled){
try{
Thread.sleep(2000);
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---START-01");
String nowFirst = DateUtil.firstOneDay(DateUtil.printDate(new Date()));
String nowFin = DateUtil.finOneDay(DateUtil.printDate(new Date()));
String nowFinByQuery = DateUtil.addDay(DateUtil.finOneDay(DateUtil.printDate(new Date())),1);
System.out.println("当前月第一日:"+nowFirst);
System.out.println("当前月最后一日:"+nowFin);
SarBussionessStand stand = new SarBussionessStand();
stand.setIssueTimeStart(nowFirst);
stand.setIssueTimeEnd(nowFin);
List<SarBussionessStand> standList = sarBussionessStandDao.queryByBussStateSync(stand);
if(!standList.isEmpty()){
List<SarBussionessStandState> filterList = new ArrayList<>();
standList.forEach(sarBussionessStand -> {
SarBussionessStandState state = new SarBussionessStandState();
state.setStandId(sarBussionessStand.getId());
state.setStandCode(sarBussionessStand.getStandCode());
state.setStandName(sarBussionessStand.getStandName());
if(DateUtil.printToDate(sarBussionessStand.getIssueTime()) != null){
state.setIssueTime(sarBussionessStand.getIssueTime());
}
if(DateUtil.printToDate(sarBussionessStand.getReviewTime()) != null){
state.setReviewTime(sarBussionessStand.getReviewTime());
}
state.setCreationTime(DateUtil.printDateAll(new Date()));
state.setModifyTime(DateUtil.printDateAll(new Date()));
filterList.add(state);
});
List<SarBussionessStandState> insList = new ArrayList<>();
List<SarBussionessStandState> updList = new ArrayList<>();
QueryWrapper wrapper = new QueryWrapper();
wrapper.isNull("REVIEW_RESULTS");
wrapper.between("REVIEW_TIME",nowFirst,nowFinByQuery);
List<SarBussionessStandState> stateList = bussionessStandStateService.list(wrapper);
if(!stateList.isEmpty()){
// 差集 (list1 - list2) 新增复审表
List<SarBussionessStandState> distinctByUniqueList = filterList.stream()
.filter(item -> !stateList.stream()
.map(SarBussionessStandState::getStandId)
.collect(Collectors.toList())
.contains(item.getStandId()))
.collect(Collectors.toList());
insList.addAll(distinctByUniqueList);
// 交集 更新复审表
List<SarBussionessStandState> intersection = filterList.stream()
.filter(item -> stateList.stream()
.map(SarBussionessStandState::getStandId)
.collect(Collectors.toList())
.contains(item.getStandId()))
.collect(Collectors.toList());
// jdk8 stream 更新集合批量赋值ID
List<SarBussionessStandState> updSetList = intersection.stream()
.map(upObj -> stateList.stream()
.filter(stateQueryObj -> upObj.getStandId().equals(stateQueryObj.getStandId()))
.findFirst()
.map(stateQueryObj -> {
upObj.setId(stateQueryObj.getId());
upObj.setModifyTime(DateUtil.printDateAll(new Date()));
return upObj;
}).orElse(null))
.collect(Collectors.toList());
updList.addAll(updSetList);
}else {
// 新增复审表
insList.addAll(filterList);
}
// 复审表操作逻辑 新增
if(!insList.isEmpty()){
bussionessStandStateService.saveBatch(insList);
}
// 复审表操作逻辑 更新
if(!updList.isEmpty()){
// List<SarBussionessStandState> updListResult = updList.stream().peek(p -> p.setModifyTime(DateUtil.printDateAll(new Date()))).collect(Collectors.toList());
bussionessStandStateService.updateBatchById(updList);
}
}
logger.info("月初:"+Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---End-01");
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
// 月末
@Scheduled(cron="0 0 1 28-31 * ?")
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void StandScheduledJobMonthEnd(){
if(isNotScheduled){
try{
Thread.sleep(2000);
// 判断当前日期是否为月末
Date date = new Date();
if(isLastDayOfMonth(date)){
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---START-01");
String nextFirst = DateUtil.printDate(DateUtil.nextMonthFirstDate());
String nextFin = DateUtil.finOneDay(DateUtil.printDate(DateUtil.nextMonthFirstDate()));
String nextFinByQuery = DateUtil.addDay(DateUtil.finOneDay(DateUtil.printDate(DateUtil.nextMonthFirstDate())),1);
System.out.println("下个月第一日:"+ nextFirst);
System.out.println("下个月最后一日:"+nextFin);
SarBussionessStand stand = new SarBussionessStand();
stand.setIssueTimeStart(nextFirst);
stand.setIssueTimeEnd(nextFin);
List<SarBussionessStand> standList = sarBussionessStandDao.queryByBussStateSync(stand);
if(!standList.isEmpty()){
List<SarBussionessStandState> filterList = new ArrayList<>();
standList.forEach(sarBussionessStand -> {
SarBussionessStandState state = new SarBussionessStandState();
state.setStandId(sarBussionessStand.getId());
state.setStandCode(sarBussionessStand.getStandCode());
state.setStandName(sarBussionessStand.getStandName());
if(DateUtil.printToDate(sarBussionessStand.getIssueTime()) != null){
state.setIssueTime(sarBussionessStand.getIssueTime());
}
if(DateUtil.printToDate(sarBussionessStand.getReviewTime()) != null){
state.setReviewTime(sarBussionessStand.getReviewTime());
}
state.setCreationTime(DateUtil.printDateAll(new Date()));
state.setModifyTime(DateUtil.printDateAll(new Date()));
filterList.add(state);
});
List<SarBussionessStandState> insList = new ArrayList<>();
List<SarBussionessStandState> updList = new ArrayList<>();
QueryWrapper wrapper = new QueryWrapper();
wrapper.isNull("REVIEW_RESULTS");
wrapper.between("REVIEW_TIME",nextFirst,nextFinByQuery);
List<SarBussionessStandState> stateList = bussionessStandStateService.list(wrapper);
if(!stateList.isEmpty()){
// 差集 (list1 - list2) 新增复审表
List<SarBussionessStandState> distinctByUniqueList = filterList.stream()
.filter(item -> !stateList.stream()
.map(SarBussionessStandState::getStandId)
.collect(Collectors.toList())
.contains(item.getStandId()))
.collect(Collectors.toList());
insList.addAll(distinctByUniqueList);
// 交集 更新复审表
List<SarBussionessStandState> intersection = filterList.stream()
.filter(item -> stateList.stream()
.map(SarBussionessStandState::getStandId)
.collect(Collectors.toList())
.contains(item.getStandId()))
.collect(Collectors.toList());
// jdk8 stream 更新集合批量赋值ID
List<SarBussionessStandState> updSetList = intersection.stream()
.map(upObj -> stateList.stream()
.filter(stateQueryObj -> upObj.getStandId().equals(stateQueryObj.getStandId()))
.findFirst()
.map(stateQueryObj -> {
upObj.setId(stateQueryObj.getId());
upObj.setModifyTime(DateUtil.printDateAll(new Date()));
return upObj;
}).orElse(null))
.collect(Collectors.toList());
updList.addAll(updSetList);
}else {
// 新增复审表
insList.addAll(filterList);
}
// 复审表操作逻辑 新增
if(!insList.isEmpty()){
bussionessStandStateService.saveBatch(insList);
}
// 复审表操作逻辑 更新
if(!updList.isEmpty()){
// List<SarBussionessStandState> updListResult = updList.stream().peek(p -> p.setModifyTime(DateUtil.printDateAll(new Date()))).collect(Collectors.toList());
bussionessStandStateService.updateBatchById(updList);
}
}
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"---End-01");
}else {
logger.info("月末:"+Thread.currentThread().getName() + " cron=0 0 1 28-31 * ? --- " + new Date()+"当前日期不是最后一日---End-01");
}
}catch(Exception e){
logger.info(e.getMessage());
}
}
}
/** * 判断给定日期是否为月末的一天 * * @param date * @return true:是|false:不是 */
public static boolean isLastDayOfMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DATE, (calendar.get(Calendar.DATE) + 1));
if (calendar.get(Calendar.DAY_OF_MONTH) == 1){
return true;
}
return false;
}
}
@@ -325,21 +325,26 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
List<String> managementHostList = new ArrayList<>();
List<String> developmentHostList = new ArrayList<>();
List<String> categoryList = new ArrayList<>();
List<String> statusList=new ArrayList<>();
for(SarStandProjectLibrary sarStandProjectLibrary1 : list){
if(!managementHostList.contains(sarStandProjectLibrary1.getManagementHostName())){
if(null!= sarStandProjectLibrary1.getManagementHostName()&& !"".equals(sarStandProjectLibrary1.getManagementHostName()) && !managementHostList.contains(sarStandProjectLibrary1.getManagementHostName())){
managementHostList.add(sarStandProjectLibrary1.getManagementHostName());
}
if(!developmentHostList.contains(sarStandProjectLibrary1.getDevelopmentHostName())){
if(null!= sarStandProjectLibrary1.getDevelopmentHostName()&& !"".equals(sarStandProjectLibrary1.getDevelopmentHostName()) && !developmentHostList.contains(sarStandProjectLibrary1.getDevelopmentHostName())){
developmentHostList.add(sarStandProjectLibrary1.getDevelopmentHostName());
}
if(!categoryList.contains(sarStandProjectLibrary1.getCategoryName())){
if(null!= sarStandProjectLibrary1.getCategoryName()&& !"".equals(sarStandProjectLibrary1.getCategoryName()) && !categoryList.contains(sarStandProjectLibrary1.getCategoryName())){
categoryList.add(sarStandProjectLibrary1.getCategoryName());
}
if (null!= sarStandProjectLibrary1.getProjectStatus()&& !"".equals(sarStandProjectLibrary1.getProjectStatus()) && !statusList.contains(sarStandProjectLibrary1.getProjectStatus())){
statusList.add(sarStandProjectLibrary1.getProjectStatus());
}
}
QuerySelectRspDTO querySelectRspDTO = QuerySelectRspDTO.builder()
.managementHostList(managementHostList)
.developmentHostList(developmentHostList)
.categoryList(categoryList)
.statusList(statusList)
.build();
return Result.success(querySelectRspDTO);
}
@@ -14,4 +14,6 @@ public class QuerySelectRspDTO {
private List<String> developmentHostList;
private List<String> categoryList;
private List<String> statusList;
}
@@ -11,6 +11,93 @@ import java.util.*;
*/
public class DateUtil {
public static String addDay(String date, Integer dayInt) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date today = null;
try {
today = sdf.parse(date);
} catch (ParseException e) {
}
String endDate = sdf.format(today);//当前日期
Calendar theCa = Calendar.getInstance();
theCa.setTime(today);
theCa.add(theCa.DATE, +dayInt);//最后一个数字30可改,30天的意思
Date start = theCa.getTime();
String startDate = sdf.format(start);//三十天之前日期
return startDate;
}
public static Date nextMonthFirstDate() {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.add(Calendar.MONTH, 1);
return calendar.getTime();
}
public static Date printToDate(String date) {
Date date1 = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
date1 = sdf.parse(date);
}catch (Exception e){
e.getMessage();
}
return date1;
}
public static String printDateAll(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(date);
}
public static String printDate(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
}
public static String firstOneDay(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date today = null;
String startDate = "";
try {
today = sdf.parse(date);
String endDate = sdf.format(today);//当前日期
Calendar theCa = Calendar.getInstance();
theCa.setTime(today);
theCa.add(Calendar.MONTH, 0);
theCa.set(Calendar.DAY_OF_MONTH, 1);
Date start = theCa.getTime();
startDate = sdf.format(start);
} catch (ParseException e) {
}
return startDate;
}
public static String finOneDay(String date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date today = null;
String startDate = "";
try {
today = sdf.parse(date);
String endDate = sdf.format(today);//当前日期
Calendar theCa = Calendar.getInstance();
theCa.setTime(today);
theCa.set(Calendar.DAY_OF_MONTH, 1);
theCa.set(Calendar.DATE, theCa.getActualMaximum(Calendar.DATE));
Date start = theCa.getTime();
startDate = sdf.format(start);
} catch (ParseException e) {
}
return startDate;
}
/**
* 取起始时间到结束时间 所有的时间
* @param startTime
@@ -115,6 +202,12 @@ public class DateUtil {
public static void main(String[] args) {
System.out.println(printDate(new Date()));
System.out.println(firstOneDay(printDate(new Date())));
System.out.println(finOneDay(printDate(new Date())));
System.out.println(addDay(finOneDay(printDate(new Date())),2));
System.out.println(printDate(nextMonthFirstDate()));
System.out.println(finOneDay(printDate(nextMonthFirstDate())));
String utcTime = "2021-04-15T01:43:54.296Z";
String time = formatStrUTCToDateStr("2021-04-15T01:43:54.296Z");
System.out.println("utcTime 转换前:" + utcTime);
@@ -367,6 +367,27 @@
</if>
</select>
<select id="queryByBussStateSync" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand">
SELECT
<include refid="Base_Column_List"/>,
DATE_SUB(DATE_ADD(ISSUE_TIME, INTERVAL 5 YEAR),INTERVAL 1 MONTH) AS reviewTime
FROM sar_bussioness_stand
WHERE stand_sort = 'Q/QCBFC'
AND ISSUE_TIME IS NOT NULL
AND DATE_FORMAT(DATE_SUB(DATE_ADD(ISSUE_TIME, INTERVAL 5 YEAR),INTERVAL 1 MONTH),'%Y-%m-%d')
BETWEEN DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d') AND DATE_ADD(DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d'),INTERVAL 1 DAY)
UNION
SELECT
<include refid="Base_Column_List"/>,
DATE_SUB(DATE_ADD(ISSUE_TIME, INTERVAL 3 YEAR),INTERVAL 1 MONTH) AS reviewTime
FROM sar_bussioness_stand
WHERE stand_sort != 'Q/QCBFC'
AND ISSUE_TIME IS NOT NULL
AND DATE_FORMAT(DATE_SUB(DATE_ADD(ISSUE_TIME, INTERVAL 3 YEAR),INTERVAL 1 MONTH),'%Y-%m-%d')
BETWEEN DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d') AND DATE_ADD(DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d'),INTERVAL 1 DAY)
</select>
<!-- 分页查询条件 -->
<sql id="standSort_in">
@@ -32,19 +32,19 @@
and DATE_FORMAT(REVIEW_TIME, '%Y-%m-%d') between DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d') AND DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
</if>
<if test="reviewTimeStart != null and reviewTimeStart != '' and reviewTimeEnd == null and reviewTimeEnd == ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &gt;= DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &gt;= DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d')
</if>
<if test="reviewTimeStart == null and reviewTimeStart == '' and reviewTimeEnd != null and reviewTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &lt;= DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
</if>
<if test="issueTimeStart != null and issueTimeStart != '' and issueTimeEnd != null and issueTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME, '%Y-%m-%d') between DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d') AND DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
</if>
<if test="issueTimeStart != null and issueTimeStart != '' and issueTimeEnd == null and issueTimeEnd == ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &gt;= DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &gt;= DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d')
</if>
<if test="issueTimeStart == null and issueTimeStart == '' and issueTimeEnd != null and issueTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &lt;= DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
</if>
</trim>
</sql>
@@ -58,19 +58,19 @@
and DATE_FORMAT(REVIEW_TIME, '%Y-%m-%d') between DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d') AND DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
</if>
<if test="reviewTimeStart != null and reviewTimeStart != '' and reviewTimeEnd == null and reviewTimeEnd == ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &gt;= DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &gt;= DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d')
</if>
<if test="reviewTimeStart == null and reviewTimeStart == '' and reviewTimeEnd != null and reviewTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &lt;= DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
</if>
<if test="issueTimeStart != null and issueTimeStart != '' and issueTimeEnd != null and issueTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME, '%Y-%m-%d') between DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d') AND DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
</if>
<if test="issueTimeStart != null and issueTimeStart != '' and issueTimeEnd == null and issueTimeEnd == ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &gt;= DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &gt;= DATE_FORMAT(#{issueTimeStart}, '%Y-%m-%d')
</if>
<if test="issueTimeStart == null and issueTimeStart == '' and issueTimeEnd != null and issueTimeEnd != ''">
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%D') &lt;= DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
and DATE_FORMAT(REVIEW_TIME,'%Y-%m-%d') &lt;= DATE_FORMAT(#{issueTimeEnd}, '%Y-%m-%d')
</if>
</trim>
</sql>