Commit 588840a3 authored by 廖旭伟's avatar 廖旭伟

测试bug修改

parent b3deb6ac
...@@ -110,15 +110,7 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff ...@@ -110,15 +110,7 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
@Override @Override
protected void doListBefore(StaffCareEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(StaffCareEntity query, Map<String, Object> model, Context context) throws AppException {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
if(query.getYear()==null){
query.setYear(year);
}
if(query.getMonth()==null){
query.setMonth(month);
}
// YearMonth yearMonth = YearMonth.of(year,month); // YearMonth yearMonth = YearMonth.of(year,month);
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// if(query.getCareType()==1){ // if(query.getCareType()==1){
...@@ -134,6 +126,15 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff ...@@ -134,6 +126,15 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
@Override @Override
protected int doListAfter(StaffCareEntity query, Map<String, Object> model, Context context) throws AppException { protected int doListAfter(StaffCareEntity query, Map<String, Object> model, Context context) throws AppException {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH)+1;
if(query.getYear()==null){
query.setYear(year);
}
if(query.getMonth()==null){
query.setMonth(month);
}
query.setCareType(1); query.setCareType(1);
int shengri = this.service.getStaffCareListCount(query); int shengri = this.service.getStaffCareListCount(query);
query.setCareType(2); query.setCareType(2);
......
...@@ -7,25 +7,26 @@ ...@@ -7,25 +7,26 @@
select a.* select a.*
from mortals_xhx_staff_care as a from mortals_xhx_staff_care as a
where 1=1 where 1=1
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
<if test="careType != null and careType ==1"> <if test="careType != null and careType ==1">
and a.careType = 1 and a.careType = 1
<if test="month != null">
and MONTH(a.birthday) = #{month} and MONTH(a.birthday) = #{month}
</if>
<if test="day != null"> <if test="day != null">
and DAY(a.birthday) = #{day} and DAY(a.birthday) = #{day}
</if> </if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if> </if>
<if test="careType != null and careType ==2"> <if test="careType != null and careType ==2">
and a.careType = 2 and a.careType = 2
<if test="month != null">
and MONTH(a.entryDate) = #{month} and MONTH(a.entryDate) = #{month}
</if>
<if test="day != null"> <if test="day != null">
and DAY(a.entryDate) = #{day} and DAY(a.entryDate) = #{day}
</if> </if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if> </if>
</select> </select>
...@@ -35,26 +36,26 @@ ...@@ -35,26 +36,26 @@
select count(1) select count(1)
from mortals_xhx_staff_care as a from mortals_xhx_staff_care as a
where 1=1 where 1=1
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
<if test="careType != null and careType ==1"> <if test="careType != null and careType ==1">
and a.careType = 1 and a.careType = 1
<if test="month != null">
and MONTH(a.birthday) = #{month} and MONTH(a.birthday) = #{month}
</if>
<if test="day != null"> <if test="day != null">
and DAY(a.birthday) = #{day} and DAY(a.birthday) = #{day}
</if> </if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if> </if>
<if test="careType != null and careType ==2"> <if test="careType != null and careType ==2">
and a.careType = 2 and a.careType = 2
<if test="month != null">
and MONTH(a.entryDate) = #{month} and MONTH(a.entryDate) = #{month}
</if>
<if test="day != null"> <if test="day != null">
and DAY(a.entryDate) = #{day} and DAY(a.entryDate) = #{day}
</if> </if>
<if test="staffName != null and staffName != ''">
and a.staffName like #{staffName}
</if>
</if> </if>
</select> </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