Commit 3ffd0f32 authored by 廖旭伟's avatar 廖旭伟

查询所有类别绩效核查记录

parent 7b729d39
...@@ -8,7 +8,9 @@ import org.mybatis.spring.support.SqlSessionDaoSupport; ...@@ -8,7 +8,9 @@ import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 全部类型核查信息Dao * 全部类型核查信息Dao
...@@ -28,7 +30,8 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check ...@@ -28,7 +30,8 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check
} }
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) { public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery) {
return this.getSqlSession().selectList(this.getSqlId("getList"), query);
return this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
} }
} }
package com.mortals.xhx.module.check.model; package com.mortals.xhx.module.check.model;
import lombok.Data;
@Data
public class CheckAllRecordQuery { public class CheckAllRecordQuery {
/** /**
* 员工ID * 员工ID
...@@ -18,4 +15,44 @@ public class CheckAllRecordQuery { ...@@ -18,4 +15,44 @@ public class CheckAllRecordQuery {
private String createTimeEnd; private String createTimeEnd;
private Long createUserId; private Long createUserId;
public Long getStaffId() {
return staffId;
}
public void setStaffId(Long staffId) {
this.staffId = staffId;
}
public Integer getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(Integer checkStatus) {
this.checkStatus = checkStatus;
}
public String getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(String createTimeStart) {
this.createTimeStart = createTimeStart;
}
public String getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(String createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
} }
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao; import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
...@@ -8,6 +9,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -8,6 +9,8 @@ import lombok.extern.slf4j.Slf4j;
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 java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List; import java.util.List;
@Service("checkAllRecordService") @Service("checkAllRecordService")
...@@ -19,6 +22,16 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService { ...@@ -19,6 +22,16 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) { public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) {
if(StringUtils.isEmpty(query.getCreateTimeStart())||StringUtils.isEmpty(query.getCreateTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
calendar.set(Calendar.DAY_OF_MONTH, 1);
String startTime = format.format(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
String endTime = format.format(calendar.getTime());
query.setCreateTimeStart(startTime);
query.setCreateTimeEnd(endTime);
}
return checkAllRecordDao.getAllCheckRecord(query); return checkAllRecordDao.getAllCheckRecord(query);
} }
} }
...@@ -5,45 +5,45 @@ ...@@ -5,45 +5,45 @@
<select id="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo"> <select id="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo">
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType FROM mortals_xhx_check_attend_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType FROM mortals_xhx_check_effect_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType FROM mortals_xhx_check_complain_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType FROM mortals_xhx_check_gowork_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType FROM mortals_xhx_check_review_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType FROM mortals_xhx_check_other_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if> <if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeStart != null and createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="createTimeEnd != null and createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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