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

达州考勤系统

parent 2e2a627f
......@@ -6,8 +6,8 @@ package com.mortals.xhx.common.key;
*
*/
public class ParamKey {
/** 文件访问的地址 */
/** 文件访问的地址 */
public static final String FILE_URL = "iot:base:param:fileUrl";
/** 物料编码长度,默认6 */
public static final String MATERIA_CODE_LENGTH = "iot:base:param:materia:length";
......@@ -31,4 +31,8 @@ public class ParamKey {
public static String SYS_PARAM_XNJC_URL = "xnjc_url";
public static String STAFF_CARE_BIRTHDAY_SEND = "StaffCareBirthdaySend";
public static String STAFF_CARE_ENTRYDATE_SEND = "StaffCareEntryDateSend";
}
package com.mortals.xhx.daemon.task;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffCareService;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.*;
import static com.mortals.xhx.common.key.ParamKey.STAFF_CARE_BIRTHDAY_SEND;
import static com.mortals.xhx.common.key.ParamKey.STAFF_CARE_ENTRYDATE_SEND;
/**
* 员工关怀短信发送
*/
@Slf4j
@Service("SendStaffCareSMSTask")
public class SendStaffCareSMSTaskImpl implements ITaskExcuteService {
@Autowired
private StaffCareService staffCareService;
@Autowired
private ParamService paramService;
@Autowired
private StaffService staffService;
@Value("${sms.smsSendUrl:http://sms.wx3.com.cn/api/index/index}")
private String smsApiUrl;
@Value("${sms.apiId:ADsUXLrS81vZDU95}")
private String appid;
/**
* 短信模板ID
**/
private static String SMS_TPYE = "44";
@Override
public void excuteTask(ITask task) throws AppException {
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH)+1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
if(month==1 && day==1){
//每年1月1日重置关怀短信发送状态
staffCareService.getDao().initSendStatus();
}
StaffCareEntity query = new StaffCareEntity();
query.setMonth(month);
query.setDay(day);
String StaffCareBirthdaySend = paramService.getValueByKey(STAFF_CARE_BIRTHDAY_SEND);
if(StringUtils.isEmpty(StaffCareBirthdaySend)){
StaffCareBirthdaySend="1";
}
String StaffCareEntryDateSend = paramService.getValueByKey(STAFF_CARE_ENTRYDATE_SEND);
if(StringUtils.isEmpty(StaffCareEntryDateSend)){
StaffCareEntryDateSend="1";
}
List<StaffCareEntity> staffCareList = staffCareService.getStaffCareList(query);
List<StaffCareEntity> updateList = new ArrayList<>();
if(StaffCareBirthdaySend.equals("1")) {
query.setCareType(1);
if (CollectionUtils.isNotEmpty(staffCareList)) {
for (StaffCareEntity item : staffCareList) {
StaffEntity staffEntity = staffService.getCache(item.getStaffId().toString());
if (staffEntity != null) {
String mobileNumber = staffEntity.getPhoneNumber();
if (StringUtils.isEmpty(mobileNumber)) {
continue;
}
if (PhoneUtil.isPhone(mobileNumber)) {
Map<String, String> params = new HashMap<>();
params.put("appid", appid);
params.put("phone", mobileNumber);
params.put("type", SMS_TPYE);
String[] json = new String[1];
json[0] = String.format("亲爱的[%s],祝你生日快乐!愿你在新的一岁里健康、快乐、成功!公司永远是你坚强的后盾。", item.getStaffName());
params.put("json", JSONObject.toJSON(json).toString());
try {
String resp = HttpUtil.doPost(smsApiUrl, params);
JSONObject respJson = JSONObject.parseObject(resp);
if (respJson.getIntValue("code") == 0) {
log.info("短信发送失败:" + respJson.getString("message"));
} else {
item.setSendStatus(1);
item.setExcuteTime(new Date());
item.setUpdateTime(new Date());
updateList.add(item);
}
} catch (Exception e) {
log.error("短信发送异常", e);
}
}
}
}
}
}
if(StaffCareEntryDateSend.equals("1")) {
query.setCareType(2);
staffCareList = staffCareService.getStaffCareList(query);
for (StaffCareEntity item : staffCareList) {
StaffEntity staffEntity = staffService.getCache(item.getStaffId().toString());
if (staffEntity != null) {
String mobileNumber = staffEntity.getPhoneNumber();
if (StringUtils.isEmpty(mobileNumber)) {
continue;
}
if (PhoneUtil.isPhone(mobileNumber)) {
Map<String, String> params = new HashMap<>();
params.put("appid", appid);
params.put("phone", mobileNumber);
params.put("type", SMS_TPYE);
String[] json = new String[1];
json[0] = String.format("亲爱的[%s],入职周年快乐!愿你一路走来的每一步都铺就了成功的基石,未来继续高飞,前程似锦!", item.getStaffName());
params.put("json", JSONObject.toJSON(json).toString());
try {
String resp = HttpUtil.doPost(smsApiUrl, params);
JSONObject respJson = JSONObject.parseObject(resp);
if (respJson.getIntValue("code") == 0) {
log.info("短信发送失败:" + respJson.getString("message"));
} else {
item.setSendStatus(1);
item.setExcuteTime(new Date());
item.setUpdateTime(new Date());
updateList.add(item);
}
} catch (Exception e) {
log.error("短信发送异常", e);
}
}
}
}
}
if(updateList.size()>0){
staffCareService.update(updateList);
}
}
@Override
public void stopTask(ITask task) throws AppException {
}
}
......@@ -25,7 +25,6 @@ public class JobServiceImpl extends AbstractCRUDServiceImpl<JobDao, JobEntity, L
protected void findAfter(JobEntity entity, Context context, List<JobEntity> list) throws AppException {
list.stream().peek(item -> {
List<JobEntity> childs = this.find(new JobQuery().groupId(item.getId()));
System.out.println("111"+childs);
if (!ObjectUtils.isEmpty(childs)) {
item.setChildren(childs);
} else {
......
......@@ -2,16 +2,22 @@ package com.mortals.xhx.module.staff.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import com.mortals.xhx.module.staff.model.StaffCareQuery;
import java.util.List;
/**
* 员工关怀信息Dao
* 员工关怀信息 DAO接口
*
* @author zxfei
* @date 2023-04-07
*/
* 员工关怀信息Dao
* 员工关怀信息 DAO接口
*
* @author zxfei
* @date 2023-04-07
*/
public interface StaffCareDao extends ICRUDDao<StaffCareEntity,Long>{
List<StaffCareEntity> getStaffCareList(StaffCareEntity query);
int getStaffCareListCount(StaffCareEntity query);
int initSendStatus();
}
package com.mortals.xhx.module.staff.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.staff.dao.StaffCareDao;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 员工关怀信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-04-07
*/
* 员工关怀信息DaoImpl DAO接口
*
* @author zxfei
* @date 2023-04-07
*/
@Repository("staffCareDao")
public class StaffCareDaoImpl extends BaseCRUDDaoMybatis<StaffCareEntity,Long> implements StaffCareDao {
@Override
public List<StaffCareEntity> getStaffCareList(StaffCareEntity query) {
return this.getSqlSession().selectList(this.getSqlId("getStaffCareList"), query);
}
@Override
public int getStaffCareListCount(StaffCareEntity query) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getStaffCareListCount"), query);
}
@Override
public int initSendStatus() {
return this.getSqlSession().update(this.getSqlId("initSendStatus"));
}
}
package com.mortals.xhx.module.staff.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.staff.model.vo.StaffCareVo;
import lombok.Data;
/**
* 员工关怀信息实体对象
*
* @author zxfei
* @date 2023-04-07
*/
* 员工关怀信息实体对象
*
* @author zxfei
* @date 2025-04-15
*/
@Data
public class StaffCareEntity extends StaffCareVo {
private static final long serialVersionUID = 1L;
/**
* 员工ID
*/
* 员工ID
*/
private Long staffId;
/**
* 员工姓名
*/
* 员工姓名
*/
private String staffName;
/**
* 出生日期
*/
* 出生日期
*/
private Date birthday;
/**
* 所属部门
*/
* 所属部门
*/
private Long deptId;
/**
* 所属部门名称
*/
* 所属部门名称
*/
private String deptName;
/**
* 职位ID
*/
* 职位ID
*/
private Long jobId;
/**
* 职位名称
*/
* 职位名称
*/
private String jobName;
/**
* 入职时间
*/
* 入职时间
*/
private Date entryDate;
/**
* 关怀类型(1.生日关怀,2.入职周年关怀)
*/
* 关怀类型(1.生日关怀,2.入职周年关怀)
*/
private Integer careType;
/**
* 发送状态(0.未发送,1.已发送)
*/
* 发送状态(0.未发送,1.已发送)
*/
private Integer sendStatus;
/**
* 关怀内容
*/
* 关怀内容
*/
private String content;
public StaffCareEntity(){}
/**
* 获取 员工ID
* @return Long
*/
public Long getStaffId(){
return staffId;
}
/**
* 设置 员工ID
* @param staffId
*/
public void setStaffId(Long staffId){
this.staffId = staffId;
}
/**
* 获取 员工姓名
* @return String
*/
public String getStaffName(){
return staffName;
}
/**
* 设置 员工姓名
* @param staffName
*/
public void setStaffName(String staffName){
this.staffName = staffName;
}
/**
* 获取 出生日期
* @return Date
*/
public Date getBirthday(){
return birthday;
}
/**
* 设置 出生日期
* @param birthday
*/
public void setBirthday(Date birthday){
this.birthday = birthday;
}
/**
* 获取 所属部门
* @return Long
*/
public Long getDeptId(){
return deptId;
}
/**
* 设置 所属部门
* @param deptId
*/
public void setDeptId(Long deptId){
this.deptId = deptId;
}
/**
* 获取 所属部门名称
* @return String
*/
public String getDeptName(){
return deptName;
}
/**
* 设置 所属部门名称
* @param deptName
*/
public void setDeptName(String deptName){
this.deptName = deptName;
}
/**
* 获取 职位ID
* @return Long
*/
public Long getJobId(){
return jobId;
}
/**
* 设置 职位ID
* @param jobId
*/
public void setJobId(Long jobId){
this.jobId = jobId;
}
/**
* 获取 职位名称
* @return String
*/
public String getJobName(){
return jobName;
}
/**
* 设置 职位名称
* @param jobName
*/
public void setJobName(String jobName){
this.jobName = jobName;
}
* 执行时间
*/
private Date excuteTime;
/**
* 获取 入职时间
* @return Date
*/
public Date getEntryDate(){
return entryDate;
}
/**
* 设置 入职时间
* @param entryDate
*/
public void setEntryDate(Date entryDate){
this.entryDate = entryDate;
}
/**
* 获取 关怀类型(1.生日关怀,2.入职周年关怀)
* @return Integer
*/
public Integer getCareType(){
return careType;
}
/**
* 设置 关怀类型(1.生日关怀,2.入职周年关怀)
* @param careType
*/
public void setCareType(Integer careType){
this.careType = careType;
}
/**
* 获取 发送状态(0.未发送,1.已发送)
* @return Integer
*/
public Integer getSendStatus(){
return sendStatus;
}
/**
* 设置 发送状态(0.未发送,1.已发送)
* @param sendStatus
*/
public void setSendStatus(Integer sendStatus){
this.sendStatus = sendStatus;
}
/**
* 获取 关怀内容
* @return String
*/
public String getContent(){
return content;
}
/**
* 设置 关怀内容
* @param content
*/
public void setContent(String content){
this.content = content;
}
* 员工类型(1.全职,2.兼职,3.实习)
*/
private Integer staffType;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -233,50 +82,25 @@ public class StaffCareEntity extends StaffCareVo {
if (obj instanceof StaffCareEntity) {
StaffCareEntity tmp = (StaffCareEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",staffId:").append(getStaffId());
sb.append(",staffName:").append(getStaffName());
sb.append(",birthday:").append(getBirthday());
sb.append(",deptId:").append(getDeptId());
sb.append(",deptName:").append(getDeptName());
sb.append(",jobId:").append(getJobId());
sb.append(",jobName:").append(getJobName());
sb.append(",entryDate:").append(getEntryDate());
sb.append(",careType:").append(getCareType());
sb.append(",sendStatus:").append(getSendStatus());
sb.append(",content:").append(getContent());
return sb.toString();
}
public void initAttrValue(){
this.staffId = null;
this.staffName = "";
this.birthday = null;
this.deptId = null;
this.deptName = "";
this.jobId = null;
this.jobName = "";
this.entryDate = null;
this.careType = 1;
this.sendStatus = 0;
this.content = "";
this.staffId = null;
this.staffName = "";
this.birthday = null;
this.deptId = null;
this.deptName = "";
this.jobId = null;
this.jobName = "";
this.entryDate = null;
this.careType = 1;
this.sendStatus = 0;
this.content = "";
this.excuteTime = null;
this.staffType = 0;
}
}
\ No newline at end of file
package com.mortals.xhx.module.staff.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 员工关怀信息视图对象
*
* @author zxfei
* @date 2023-04-07
*/
* 员工关怀信息视图对象
*
* @author zxfei
* @date 2023-04-07
*/
@Data
public class StaffCareVo extends BaseEntityLong {
/**
* 年
*/
private Integer year;
/**
* 月
*/
private Integer month;
/**
* 日
*/
private Integer day;
/** 参数键,*/
private String paramType;
/** 参数值 */
private Integer paramValue;
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.staff.dao.StaffCareDao;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import com.mortals.xhx.module.staff.model.StaffCareQuery;
import java.util.List;
/**
* StaffCareService
*
* 员工关怀信息 service接口
*
* @author zxfei
* @date 2023-04-07
*/
* StaffCareService
*
* 员工关怀信息 service接口
*
* @author zxfei
* @date 2023-04-07
*/
public interface StaffCareService extends ICRUDService<StaffCareEntity,Long>{
StaffCareDao getDao();
List<StaffCareEntity> getStaffCareList(StaffCareEntity query);
int getStaffCareListCount(StaffCareEntity query);
}
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl;
import com.mortals.xhx.module.staff.model.StaffCareQuery;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -6,14 +7,26 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.staff.dao.StaffCareDao;
import com.mortals.xhx.module.staff.model.StaffCareEntity;
import com.mortals.xhx.module.staff.service.StaffCareService;
import java.util.List;
/**
* StaffCareService
* 员工关怀信息 service实现
*
* @author zxfei
* @date 2023-04-07
*/
* StaffCareService
* 员工关怀信息 service实现
*
* @author zxfei
* @date 2023-04-07
*/
@Service("staffCareService")
public class StaffCareServiceImpl extends AbstractCRUDServiceImpl<StaffCareDao, StaffCareEntity, Long> implements StaffCareService {
@Override
public List<StaffCareEntity> getStaffCareList(StaffCareEntity query) {
return this.dao.getStaffCareList(query);
}
@Override
public int getStaffCareListCount(StaffCareEntity query) {
return this.dao.getStaffCareListCount(query);
}
}
\ No newline at end of file
package com.mortals.xhx.module.staff.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.model.ParamEntity;
import com.mortals.xhx.base.system.param.model.ParamQuery;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.CareTypeEnum;
import com.mortals.xhx.common.code.SendStatusEnum;
......@@ -11,10 +16,12 @@ import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.job.model.JobEntity;
import com.mortals.xhx.module.job.model.JobQuery;
import com.mortals.xhx.module.job.service.JobService;
import com.mortals.xhx.module.staff.model.StaffCareQuery;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -30,19 +37,16 @@ import com.mortals.xhx.module.staff.service.StaffCareService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.ParamKey.*;
/**
* 员工关怀信息
......@@ -64,6 +68,7 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
@Autowired
private JobService jobService;
public StaffCareController() {
super.setModuleDesc("员工关怀信息");
}
......@@ -75,7 +80,7 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
this.addDict(model, "deptId", deptService.find(new DeptQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDeptName())));
this.addDict(model, "jobId", jobService.find(new JobQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getJobName())));
this.addDict(model, "staffId", staffService.find(new StaffQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getName())));
this.addDict(model, "staffType", paramService.getParamBySecondOrganize("Staff", "staffType"));
super.init(model, context);
}
......@@ -90,6 +95,8 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
if (!ObjectUtils.isEmpty(entity.getStaffId())) {
StaffEntity staffEntity = staffService.getCache(entity.getStaffId().toString());
entity.setStaffName(staffEntity == null ? "" : staffEntity.getName());
entity.setDeptId(staffEntity == null ? null : staffEntity.getDeptId());
entity.setStaffType(staffEntity == null ? null : staffEntity.getStaffType());
}
if (!ObjectUtils.isEmpty(entity.getDeptId())) {
DeptEntity deptEntity = deptService.get(entity.getDeptId(), context);
......@@ -97,4 +104,66 @@ public class StaffCareController extends BaseCRUDJsonBodyMappingController<Staff
}
}
@Override
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);
}
}
@Override
protected int doListAfter(StaffCareEntity query, Map<String, Object> model, Context context) throws AppException {
query.setCareType(1);
int shengri = this.service.getStaffCareListCount(query);
query.setCareType(2);
int ruzhi = this.service.getStaffCareListCount(query);
model.put("shengri", shengri);
model.put("ruzhi", ruzhi);
model.put(STAFF_CARE_BIRTHDAY_SEND, paramService.getValueByKey(STAFF_CARE_BIRTHDAY_SEND));
model.put(STAFF_CARE_ENTRYDATE_SEND, paramService.getValueByKey(STAFF_CARE_ENTRYDATE_SEND));
return 1;
}
/**
* 设置关怀发送开关
* @param query
* @return
*/
@PostMapping({"sendSwitch"})
public String sendSwitch(@RequestBody StaffCareEntity query) {
Map<String, Object> model = new HashMap();
int code = 1;
String busiDesc = "设置关怀发送开关";
try {
if(StringUtils.isNotEmpty(query.getParamType())){
ParamQuery paramQuery = new ParamQuery();
paramQuery.setParamKey(query.getParamType());
ParamEntity paramEntity = paramService.selectOne(paramQuery);
if(paramEntity!=null){
paramEntity.setParamValue(String.valueOf(query.getParamValue()));
paramService.update(paramEntity);
}
}
model.put("message_info", busiDesc + " 【成功】");
this.recordSysLog(this.request, busiDesc + " 【成功】 ");
} catch (Exception var7) {
code = -1;
this.doException(this.request, busiDesc, model, var7);
}
JSONObject ret = new JSONObject();
ret.put("code", Integer.valueOf(code));
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
}
\ No newline at end of file
......@@ -19,7 +19,7 @@
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="false" />
<property name="showSql" value="false" />
<property name="showSql" value="true" />
</plugin>
<!-- <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor">-->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<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"/>
from mortals_xhx_staff_care as a
where 1=1
<if test="careType != null and careType ==1">
and MONTH(birthday) = #{month}
<if test="day != null">
and DAY(birthday) = #{day}
</if>
</if>
<if test="careType != null and careType ==2">
and MONTH(entryDate) = #{month}
<if test="day != null">
and DAY(entryDate) = #{day}
</if>
</if>
</select>
<!-- 获取 -->
<select id="getStaffCareListCount" parameterType="com.mortals.xhx.module.staff.model.StaffCareEntity" resultType="int">
select count(1)
from mortals_xhx_staff_care as a
where 1=1
<if test="careType != null and careType ==1">
and MONTH(birthday) = #{month}
<if test="day != null">
and DAY(birthday) = #{day}
</if>
</if>
<if test="careType != null and careType ==2">
and MONTH(entryDate) = #{month}
<if test="day != null">
and DAY(entryDate) = #{day}
</if>
</if>
</select>
<update id="initSendStatus">
update mortals_xhx_staff_care as a set sendStatus = 0
</update>
</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