eight
2024-09-23 f14d9737da8bbe94e82427f2d0e727fd15c88f2e
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/jobrecord/JobRecordMapper.java
@@ -1,13 +1,18 @@
package cn.lihu.jh.module.ecg.dal.mysql.jobrecord;
import java.time.LocalDateTime;
import java.util.*;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordDO;
import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lihu.jh.module.ecg.controller.admin.jobrecord.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
 * 工作记录 Mapper
@@ -29,7 +34,18 @@
                .eqIfPresent(JobRecordDO::getSummary, reqVO.getSummary())
                .eqIfPresent(JobRecordDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(JobRecordDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(JobRecordDO::getRentId, reqVO.getRentId())
                .orderByDesc(JobRecordDO::getId));
    }
}
    @Select("SELECT * FROM lihu.job_record where rent_id=#{rentId} and job_type=#{jobType} and doc_id=#{docId} limit 1")
    JobRecordDO selectByRentIdJobTypeDocId(@Param("rentId") Long rentId, @Param("jobType") Integer jobType, @Param("docId") Long docId );
    @Select("SELECT count(1) FROM lihu.job_record where pat_id=#{patId} and TO_DAYS(job_time)=TO_DAYS(#{jobTime}) and job_type=#{jobType} ")
    Integer getPatientJobNum(@Param("patId") String patId, @Param("jobTime") LocalDateTime jobTime, @Param("jobType") Integer jobType );
    @Select("select year(job_time) as year, month(job_time) as month, doc_id, doc_name, job_type, count(1) as job_count from lihu.job_record " +
            "where job_time >= #{jobTimeFrom} and job_time < #{jobTimeTo} \n" +
            "group by year(job_time), month(job_time), doc_id, job_type;")
    List<JobRecordStatisticDO> getJobStatistic(@Param("jobTimeFrom") LocalDateTime jobTimeFrom, @Param("jobTimeTo") LocalDateTime jobTimeTo);
}