万材erp项目
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.
 
 
 
 

56 lines
4.0 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.ruoyi.produce.mapper.MaterialRequisitionHeadMapper">
<select id="selectHeadWithList" resultType="com.ruoyi.produce.domain.MaterialRequisitionHeadWithList" parameterType="com.ruoyi.produce.domain.MaterialRequisitionHeadWithList">
SELECT
material_requisition_head.materialRequisitionNo as materialRequisitionNo,
material_requisition_head.workOrderNo as workOrderNo,
material_requisition_head.outputDate as outputDate,
material_requisition_list.batchNum as batchNum,
material_requisition_list.itemCode as itemCode,
material_requisition_list.itemName as itemName,
material_requisition_list.itemSpecification as itemSpecification,
material_requisition_list.unit as unit,
material_requisition_list.planQty as planQty,
material_requisition_list.coinType as coinType,
material_requisition_list.price as price,
material_requisition_list.totalPrice as totalPrice,
material_requisition_head.departmentName as departmentName,
material_requisition_head.linkman as linkman,
material_requisition_head.stockName as stockName,
material_requisition_head.outputClass as outputClass,
material_requisition_list.spare1 as itemClass,
material_requisition_head.getFlag as getFlag,
material_requisition_head.endFlag as endFlag
FROM
material_requisition_list
LEFT JOIN material_requisition_head ON material_requisition_head.materialRequisitionNo = material_requisition_list.materialRequisitionNo
<where>
<if test="materialRequisitionNo != null and materialRequisitionNo != ''"> and materialRequisitionNo like concat('%', #{materialRequisitionNo}, '%')</if>
<if test="workOrderNo != null and workOrderNo != ''"> and workOrderNo like concat('%', #{workOrderNo}, '%')</if>
<if test="batchNum != null and batchNum != ''"> and batchNum like concat('%', #{batchNum}, '%')</if>
<if test="itemCode != null and itemCode != ''"> and itemCode like concat('%', #{itemCode}, '%')</if>
<if test="itemName != null and itemName != ''"> and itemName like concat('%', #{itemName}, '%')</if>
<if test="itemSpecification != null and itemSpecification != ''"> and itemSpecification like concat('%', #{itemSpecification}, '%')</if>
<if test="planQty != null and planQty != ''"> and planQty = #{planQty}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="coinType != null and coinType != ''"> and coinType = #{coinType}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate !=''"> and outputDate >= #{params.beginOutputDate}</if>
<if test="params.endOutputDate != null and params.endOutputDate != ''">and #{params.endOutputDate} >= outputDate</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="totalPrice != null and totalPrice != ''"> and totalPrice like concat('%', #{totalPrice}, '%')</if>
<if test="departmentName != null and departmentName != ''"> and departmentName like concat('%', #{departmentName}, '%')</if>
<if test="linkman != null and linkman != ''"> and linkman like concat('%', #{linkman}, '%')</if>
<if test="stockName != null and stockName != ''"> and stockName like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and outputClass = #{outputClass}</if>
<if test="itemClass != null and itemClass != ''"> and itemClass = #{itemClass}</if>
<if test="getFlag != null and getFlag != ''"> and getFlag = #{getFlag}</if>
<if test="endFlag != null and endFlag != ''"> and endFlag = #{endFlag}</if>
</where>
</select>
</mapper>