Commit fbacf05f authored by 廖旭伟's avatar 廖旭伟

测试bug修改

parent 87d7c09a
......@@ -359,7 +359,7 @@ public class AttendanceStatServiceImpl extends AbstractCRUDServiceImpl<Attendanc
statMap.put(temp.getStaffId(),temp);
}
String attendanceSummary = "";
int normal = 4; //正常次数
int normal = 2; //正常次数
if (item.getMorningTimes() > 0) {
attendanceSummary += "缺卡*" + item.getMorningTimes() + "次;";
normal= normal-item.getMorningTimes();
......
......@@ -2,10 +2,15 @@ package com.mortals.xhx.module.staff.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.staff.dao.StaffCareDao;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
/**
* 员工关怀信息DaoImpl DAO接口
......@@ -32,5 +37,38 @@ public class StaffCareDaoImpl extends BaseCRUDDaoMybatis<StaffCareEntity,Long> i
return this.getSqlSession().update(this.getSqlId("initSendStatus"));
}
@Override
public Result<StaffCareEntity> getList(StaffCareEntity params, PageInfo pageInfo) {
Result result = new Result();
List list = null;
if (pageInfo.isCountPage()) {
int count = this.getStaffCareListCount(params);
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getStaffCareList"), params);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getStaffCareList"), params, rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
} else {
if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getStaffCareList"), params);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getStaffCareList"), params, rowBounds);
}
pageInfo.setTotalResult(-1);
result.setPageInfo(pageInfo);
result.setList(list);
}
return result;
}
}
......@@ -31,4 +31,14 @@ public class StaffCareVo extends BaseEntityLong {
/** 参数值 */
private Integer paramValue;
/** 开始 出生日期 */
private String birthdayStart;
/** 结束 出生日期 */
private String birthdayEnd;
/** 开始 入职时间 */
private String entryDateStart;
/** 结束 入职时间 */
private String entryDateEnd;
}
\ No newline at end of file
package com.mortals.xhx.module.staff.web;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
......@@ -37,6 +38,8 @@ import com.mortals.xhx.module.staff.service.StaffCareService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
......@@ -116,6 +119,16 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
if(query.getMonth()==null){
query.setMonth(month);
}
// YearMonth yearMonth = YearMonth.of(year,month);
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// if(query.getCareType()==1){
// query.setBirthdayStart(yearMonth.atDay(1).format(formatter));
// query.setBirthdayEnd(yearMonth.atEndOfMonth().format(formatter));
// }
// if(query.getCareType()==2){
// query.setEntryDateStart(yearMonth.atDay(1).format(formatter));
// query.setEntryDateEnd(yearMonth.atEndOfMonth().format(formatter));
// }
}
......@@ -166,4 +179,5 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
ret.put("data", model);
return ret.toJSONString();
}
}
\ No newline at end of file
......@@ -4,25 +4,32 @@
<mapper namespace="com.mortals.xhx.module.staff.dao.ibatis.StaffCareDaoImpl">
<!-- 获取列表 -->
<select id="getStaffCareList" parameterType="com.mortals.xhx.module.staff.model.StaffCareEntity" resultMap="StaffCareEntity-Map">
select <include refid="_columns"/>
select a.*
from mortals_xhx_staff_care as a
where 1=1
<if test="careType != null and careType ==1">
and MONTH(birthday) = #{month}
and a.careType = 1
and MONTH(a.birthday) = #{month}
<if test="day != null">
and DAY(birthday) = #{day}
and DAY(a.birthday) = #{day}
</if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if>
<if test="careType != null and careType ==2">
and MONTH(entryDate) = #{month}
and a.careType = 2
and MONTH(a.entryDate) = #{month}
<if test="day != null">
and DAY(entryDate) = #{day}
and DAY(a.entryDate) = #{day}
</if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if>
</select>
<!-- 获取 -->
<select id="getStaffCareListCount" parameterType="com.mortals.xhx.module.staff.model.StaffCareEntity" resultType="int">
select count(1)
......@@ -30,15 +37,23 @@
where 1=1
<if test="careType != null and careType ==1">
and MONTH(birthday) = #{month}
and a.careType = 1
and MONTH(a.birthday) = #{month}
<if test="day != null">
and DAY(birthday) = #{day}
and DAY(a.birthday) = #{day}
</if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if>
<if test="careType != null and careType ==2">
and MONTH(entryDate) = #{month}
and a.careType = 2
and MONTH(a.entryDate) = #{month}
<if test="day != null">
and DAY(entryDate) = #{day}
and DAY(a.entryDate) = #{day}
</if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if>
</select>
......
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