Browse Source

#定时任务抽离

zhongwei
yang_shj 2 years ago
parent
commit
24cafe06c0
  1. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java
  2. 16
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.java
  3. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.xml

7
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/safeproduct/InstanceMapper.java

@ -2,15 +2,10 @@ package com.hnac.hzims.scheduled.mapper.safeproduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by Sam Huang 2022/5/6 8:23
* @author Lch
*/
public interface InstanceMapper extends BaseMapper<CheckItemInstanceEntity> {
List<CheckItemInstanceEntity> getCheckItemInstanceByMonth(@Param("months") List<String> months, @Param("deptId") Long deptId);
}

16
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.java

@ -0,0 +1,16 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by Sam Huang 2022/5/6 8:23
*/
public interface CheckItemInstanceMapper extends BaseMapper<CheckItemInstanceEntity> {
List<CheckItemInstanceEntity> getCheckItemInstanceByMonth(@Param("months") List<String> months, @Param("deptId") Long deptId);
}

20
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CheckItemInstanceMapper.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CheckItemInstanceMapper">
<select id="getCheckItemInstanceByMonth" resultType="com.hnac.hzims.safeproduct.entity.CheckItemInstanceEntity">
SELECT *
FROM hzims_safe_check_item_instance t
WHERE t.IS_DELETED = 0
AND t.CHECK_ID IN (SELECT id
FROM hzims_safe_check_month
WHERE IS_DELETED = 0 AND CREATE_DEPT = #{deptId} AND MONTH IN
<foreach item="item" index="index" collection="months" open="(" separator="," close=" )">
#{item}
</foreach>
)
</select>
</mapper>
Loading…
Cancel
Save