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.

67 lines
2.9 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.xjfast.mapper.DeliveryRequisitionMapper">
  4. <resultMap id="BaseResultMap" type="com.xjfast.entity.DeliveryRequisition">
  5. <result column="id" jdbcType="INTEGER" property="id"/>
  6. <result column="site" jdbcType="VARCHAR" property="site"/>
  7. <result column="ware_house_id" jdbcType="VARCHAR" property="wareHouseId"/>
  8. <result column="part_no" jdbcType="VARCHAR" property="partNo"/>
  9. <result column="need_date" jdbcType="TIMESTAMP" property="needDate"/>
  10. <result column="qty_required" jdbcType="FLOAT" property="qtyRequired"/>
  11. <result column="status" jdbcType="VARCHAR" property="status"/>
  12. <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
  13. <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
  14. <result column="excuted_date" jdbcType="TIMESTAMP" property="excutedDate"/>
  15. <result column="excuted_by" jdbcType="VARCHAR" property="excutedBy"/>
  16. </resultMap>
  17. <select id="searchReplenishmentList" resultType="com.xjfast.entity.vo.DeliveryRequisitionVo"
  18. parameterType="com.xjfast.entity.query.DeliveryRequisitionQuery">
  19. -- 补货建议查询
  20. SELECT id,
  21. MAX( d.qty_required ) as qty_required,
  22. d.ware_house_id,
  23. d.part_no,
  24. w.WareHouseName,
  25. p.PartDescription,
  26. MIN ( d.need_date ) AS need_date,
  27. d.created_by,
  28. GETDATE() created_date,
  29. status,
  30. d.site
  31. FROM
  32. delivery_requisition d
  33. LEFT JOIN WareHouse w ON ( w.WareHouseID = d.ware_house_id )
  34. LEFT JOIN Part p ON ( p.PartNo = d.part_no )
  35. <where>
  36. <if test="site != null and site != ''">
  37. d.site = #{site}
  38. </if>
  39. <if test="warehousetypeDb != null and warehousetypeDb != ''">
  40. AND w.WareHouseType_DB= #{warehousetypeDb}
  41. </if>
  42. <if test="warehousename != null and warehousename != ''">
  43. and w.WareHouseName like '%'+#{warehousename}+'%'
  44. </if>
  45. <if test="partdescription != null and partdescription != ''">
  46. and p.PartDescription like '%'+#{partdescription}+'%'
  47. </if>
  48. </where>
  49. GROUP BY
  50. d.id,
  51. d.ware_house_id,
  52. d.part_no,
  53. d.site,
  54. w.WareHouseName,
  55. p.PartDescription,
  56. d.created_by,
  57. status
  58. </select>
  59. <select id="queryDeliveryRequisitionIds" resultType="java.lang.Integer"
  60. parameterType="com.xjfast.entity.query.DeliveryRequisitionQuery">
  61. select id
  62. from Delivery_requisition
  63. where ware_house_id = #{wareHouseId}
  64. and part_no = #{partNo}
  65. and CONVERT(varchar (10), created_date, 120) <![CDATA[=]]> CONVERT(varchar (10), GETDATE(), 120)
  66. </select>
  67. </mapper>