You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nursing-home-management-system/server/target/classes/mapper/WarehouseRecordMapper.xml

42 lines
1.8 KiB

<?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.ew.gerocomium.dao.mapper.WarehouseRecordMapper">
<select id="listWarehouseRecordByKey" resultType="com.ew.gerocomium.dao.vo.PageWarehouseRecordByKeyVo">
SELECT wr.id,
w.`name` AS warehouse_name,
wr.warehouse_date,
wr.source,
s.`name` AS staff_name,
wr.warehouse_flag
FROM warehouse_record wr
LEFT JOIN warehouse w ON w.id = wr.warehouse_id
LEFT JOIN staff s ON s.id = wr.staff_id
<where>
wr.del_flag = 'N'
<if test="startTime != null">
AND wr.warehouse_date &gt;= #{startTime}
</if>
<if test="endTime != null">
AND wr.warehouse_date &lt;= #{endTime}
</if>
<if test="keyQuery.warehouseName != null and keyQuery.warehouseName != '' and keyQuery.warehouseName != 'null'">
AND w.`name` LIKE concat('%', #{keyQuery.warehouseName,jdbcType=VARCHAR}, '%')
</if>
<if test="keyQuery.staffName != null and keyQuery.staffName != '' and keyQuery.staffName != 'null'">
AND s.`name` LIKE concat('%', #{keyQuery.staffName,jdbcType=VARCHAR}, '%')
</if>
</where>
</select>
<select id="getWarehouseRecordById" resultType="com.ew.gerocomium.dao.vo.GetWarehouseRecordByIdVo">
SELECT w.`name` AS warehouse_name,
s.`name` AS staff_name,
wr.source,
wr.warehouse_date
FROM warehouse_record wr
LEFT JOIN warehouse w ON w.id = wr.warehouse_id
LEFT JOIN staff s ON s.id = wr.staff_id
WHERE wr.id = #{warehouseRecordId}
</select>
</mapper>