Files
dc_project/src/main/resources/mapper/RecordSampleMapper.xml
2025-11-13 17:38:10 +08:00

40 lines
1.6 KiB
XML

<?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.dc.dc_project.mapper.RecordSampleMapper">
<sql id="Base_Column_List">
id,entrust_id,sample_code,sample_name,sample_type,sampling_date,
sampling_point,sampling_position,representative_count,condition_desc,storage_location,
status,remark,created_by,updated_by,created_at,
updated_at,is_deleted
</sql>
<select id="getCheckNotCheckedCount" resultType="com.dc.dc_project.model.vo.bigScreen.SystemWarningItemVo">
SELECT sys.id, sys.sample_name, sys.calibration_date data, DATEDIFF(sys.calibration_date, #{nowStr}) AS day FROM sys_record_sample sys
<where>
sys.status != 2
AND sys.is_deleted = 0
AND sys.calibration_date &lt; #{nowStr}
</where>
ORDER BY sys.calibration_date ASC
LIMIT #{page.offset}, #{page.size}
</select>
<select id="getCheckNotChecked" resultType="com.dc.dc_project.model.vo.bigScreen.SystemWarningItemVo">
SELECT
sys.id,
sys.sample_name AS name,
sys.calibration_date AS date,
DATEDIFF(sys.calibration_date, #{nowStr}) AS day
FROM sys_record_sample sys
<where>
sys.status != 2
AND sys.is_deleted = 0
AND sys.calibration_date BETWEEN #{nowStr} AND DATE_ADD(#{nowStr}, INTERVAL 15 DAY)
</where>
ORDER BY sys.calibration_date ASC
LIMIT #{page.offset}, #{page.size}
</select>
</mapper>