lanan-system/dl-module-inspection/src/main/resources/mapper/inspection/InspectionEquInfoMapper.xml

52 lines
2.4 KiB
XML
Raw Normal View History

2024-08-28 20:54:03 +08:00
<?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="cn.iocoder.yudao.module.inspection.mapper.InspectionEquInfoMapper">
<select id="selectInspectionEquInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo">
2024-12-17 16:09:49 +08:00
select * from inspection_equ_info
2024-08-28 20:54:03 +08:00
<where>
2025-02-06 18:02:12 +08:00
deleted = 0
2024-12-17 16:09:49 +08:00
<if test="inspectionEquInfo.equName != null and inspectionEquInfo.equName != ''">and equ_name like
concat('%', #{inspectionEquInfo.equName}, '%')
</if>
<if test="inspectionEquInfo.equModel != null and inspectionEquInfo.equModel != ''">and equ_model like
concat('%', #{inspectionEquInfo.equModel}, '%')
</if>
<if test="inspectionEquInfo.equNumber != null and inspectionEquInfo.equNumber != ''">and equ_number like
concat('%', #{inspectionEquInfo.equNumber}, '%')
</if>
<if test="inspectionEquInfo.params.beginNextCheckTime != null and inspectionEquInfo.params.beginNextCheckTime != '' and params.endNextCheckTime != null and params.endNextCheckTime != ''">
2024-12-17 16:09:49 +08:00
and next_check_time between #{inspectionEquInfo.params.beginNextCheckTime} and
#{inspectionEquInfo.params.endNextCheckTime}
</if>
<if test="inspectionEquInfo.type != null and inspectionEquInfo.type != ''">
and `type` = #{inspectionEquInfo.type}
</if>
2024-08-28 20:54:03 +08:00
</where>
</select>
<select id="selectInspectionEquInfoById" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo">
select * from inspection_equ_info
where id = #{id}
</select>
2025-02-21 16:42:37 +08:00
<select id="queryEquipmentCountByCategory"
resultType="cn.iocoder.yudao.module.inspection.vo.EquipmentCountVo">
2025-03-04 09:41:11 +08:00
SELECT
sd.value AS categoryId,
COUNT(iei.id) AS count,
sd.label AS categoryName
2025-02-21 16:42:37 +08:00
FROM system_dict_data sd
2025-03-04 09:41:11 +08:00
LEFT JOIN inspection_equ_info iei
ON iei.type = sd.value AND iei.deleted = 0
WHERE sd.dict_type = 'ins_equ_type'
AND sd.deleted = 0
GROUP BY sd.value, sd.label;
2025-02-21 16:42:37 +08:00
</select>
2024-08-28 20:54:03 +08:00
</mapper>