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/OutboundMaterialMapper.xml

37 lines
1.5 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.OutboundMaterialMapper">
<select id="listOutboundMaterialByOutboundRecordIdList" resultType="com.ew.gerocomium.dao.base.DropDown">
SELECT om.outbound_record_id AS id,
m.`name`
FROM outbound_material om
LEFT JOIN material m ON m.id = om.material_id
<where>
om.id IS NOT NULL
<choose>
<when test="outboundRecordIdList != null and outboundRecordIdList.size() > 0">
AND
<foreach collection="outboundRecordIdList" item="outboundRecordId" index="index"
open="(" separator=" " close=")">
<if test="index != 0">or</if>
om.outbound_record_id = #{outboundRecordId}
</foreach>
</when>
<otherwise>
AND
om.id IS NULL
</otherwise>
</choose>
</where>
</select>
<select id="listOutboundMaterialByWarehouseRecordId"
resultType="com.ew.gerocomium.dao.vo.GetOutboundRecordByIdVo$GetOutboundMaterialByIdVo">
SELECT m.`name` AS material_name,
om.outbound_num
FROM outbound_material om
LEFT JOIN material m ON m.id = om.material_id
WHERE om.outbound_record_id = #{outboundRecordId}
</select>
</mapper>