<sql id="toolCaseVo">
a.id AS "id",
a.tool_code AS "toolCode",
a.dept_id AS "deptId",
c.dept_name AS "deptName",
a.material_id AS "materialId",
a.material_id AS "material.id",
b.code AS "material.code",
b.name AS "material.name",
b.invspec AS "material.invspec",
b.unit AS "material.unit",
b.factory AS "material.factory",
b.invtype AS "material.invtype",
b.picture AS "material.picture",
a.rfid AS "rfid",
a.last_check_time AS "lastCheckTime",
a.next_check_time AS "nextCheckTime",
a.check_cycle_days AS "checkCycleDays",
a.del_flag AS "delFlag",
a.create_by AS "createBy",
a.create_time AS "createTime",
a.update_by AS "updateBy",
a.update_time AS "updateTime",
a.remark AS "remark"
</sql>
<sql id="toolCaseJoins">
LEFT JOIN sh_material b on b.id = a.material_id and b.del_flag = '0'
LEFT JOIN sys_dept c on c.dept_id = a.dept_id and c.del_flag = '0'
</sql>
<select id="selectExpireToolCaseList" resultType="com.ruoyi.station.domain.ToolCase">
SELECT
<include refid="toolCaseVo"/>
FROM sh_tool_case a
<include refid="toolCaseJoins"/>
<where>
a.del_flag = '0'
and a.next_check_time <![CDATA[ <= ]]> #{nextCheckTime}
</where>
</select>
1<![CDATA[]]>和转义字符
最新推荐文章于 2024-08-23 17:37:15 发布
这篇博客介绍了MyBatis中关于工具箱(ToolCase)的查询示例,特别是如何进行过期检查。内容包括SQL查询语句,其中包含了LEFT JOIN操作连接材料表和部门表,以及条件过滤,如del_flag为'0'和next_check_time小于指定时间。查询结果映射了多个字段,涉及工具箱的详细信息和材料属性。
摘要由CSDN通过智能技术生成