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.
 
 
 
 
 
 

68 lines
2.9 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.xjfast.mapper.DeliveryRequisitionMapper">
<resultMap id="BaseResultMap" type="com.xjfast.entity.DeliveryRequisition">
<result column="id" jdbcType="INTEGER" property="id"/>
<result column="site" jdbcType="VARCHAR" property="site"/>
<result column="ware_house_id" jdbcType="VARCHAR" property="wareHouseId"/>
<result column="part_no" jdbcType="VARCHAR" property="partNo"/>
<result column="need_date" jdbcType="TIMESTAMP" property="needDate"/>
<result column="qty_required" jdbcType="FLOAT" property="qtyRequired"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
<result column="excuted_date" jdbcType="TIMESTAMP" property="excutedDate"/>
<result column="excuted_by" jdbcType="VARCHAR" property="excutedBy"/>
</resultMap>
<select id="searchReplenishmentList" resultType="com.xjfast.entity.vo.DeliveryRequisitionVo"
parameterType="com.xjfast.entity.query.DeliveryRequisitionQuery">
-- 补货建议查询
SELECT id,
MAX( d.qty_required ) as qty_required,
d.ware_house_id,
d.part_no,
w.WareHouseName,
p.PartDescription,
MIN ( d.need_date ) AS need_date,
d.created_by,
GETDATE() created_date,
status,
d.site
FROM
delivery_requisition d
LEFT JOIN WareHouse w ON ( w.WareHouseID = d.ware_house_id )
LEFT JOIN Part p ON ( p.PartNo = d.part_no )
<where>
<if test="site != null and site != ''">
d.site = #{site}
</if>
<if test="warehousetypeDb != null and warehousetypeDb != ''">
AND w.WareHouseType_DB= #{warehousetypeDb}
</if>
<if test="warehousename != null and warehousename != ''">
and w.WareHouseName like '%'+#{warehousename}+'%'
</if>
<if test="partdescription != null and partdescription != ''">
and p.PartDescription like '%'+#{partdescription}+'%'
</if>
</where>
GROUP BY
d.id,
d.ware_house_id,
d.part_no,
d.site,
w.WareHouseName,
p.PartDescription,
d.created_by,
status
</select>
<select id="queryDeliveryRequisitionIds" resultType="java.lang.Integer"
parameterType="com.xjfast.entity.query.DeliveryRequisitionQuery">
select id
from Delivery_requisition
where ware_house_id = #{wareHouseId}
and part_no = #{partNo}
and CONVERT(varchar (10), created_date, 120) <![CDATA[=]]> CONVERT(varchar (10), GETDATE(), 120)
</select>
</mapper>