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.

87 lines
3.4 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.PartPlanInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.xjfast.entity.PartPlanInfo">
  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="cover_days" jdbcType="INTEGER" property="coverDays"/>
  10. <result column="average_consume_qty" jdbcType="VARCHAR" property="averageConsumeQty"/>
  11. </resultMap>
  12. <insert id="savePartPlanInfoList" parameterType="collection">
  13. INSERT INTO part_plan_info ( site, ware_house_id, part_no, cover_days,average_consume_qty, ware_house_type )
  14. VALUES
  15. <foreach collection="list" item="item" index="index" separator=",">
  16. (
  17. #{item.site},
  18. #{item.wareHouseId},
  19. #{item.partNo},
  20. #{item.coverDays},
  21. #{item.averageConsumeQty},
  22. #{item.wareHouseType}
  23. )
  24. </foreach>
  25. </insert>
  26. <delete id="deletePartPlanInfo" parameterType="collection">
  27. DELETE part_plan_info
  28. <where>
  29. <foreach open=" id in ( " close=" )" collection="list" item="item" index="index" separator=",">
  30. #{item.id}
  31. </foreach>
  32. </where>
  33. </delete>
  34. <select id="searchPartPlanInfoList" resultType="com.xjfast.entity.vo.PartPlanInfoVo"
  35. parameterType="com.xjfast.entity.query.PartPlanInfoQuery">
  36. SELECT
  37. ppi.id,
  38. p.site,
  39. p.PartNo as partNo,
  40. p.OtherGroup2,
  41. p.DefaultWarehouseID,
  42. ppi.cover_days,
  43. ppi.average_consume_qty,
  44. p.PartDescription,
  45. wh.WareHouseName,
  46. p.DefaultWarehouseID as wareHouseId,
  47. ppi.ware_house_type
  48. FROM
  49. part p
  50. LEFT JOIN part_plan_info ppi ON ( p.PartNo = ppi.part_no AND p.Site = ppi.site )
  51. LEFT JOIN WareHouse wh ON ( wh.WareHouseID = p.DefaultWarehouseID )
  52. <where>
  53. <if test="operating == 0 ">
  54. ppi.cover_days is not null
  55. AND ppi.average_consume_qty is not null
  56. </if>
  57. <if test="operating == 1">
  58. ppi.cover_days is null
  59. AND ppi.average_consume_qty is null
  60. </if>
  61. <if test="wareHouseTypeDb != '' and wareHouseTypeDb != null">
  62. AND ppi.ware_house_type = #{wareHouseTypeDb}
  63. </if>
  64. <if test="othergroup2 != '' and othergroup2 != null">
  65. AND p.OtherGroup2 = #{othergroup2}
  66. </if>
  67. <if test="partNo != null and partNo != ''">
  68. AND ppi.part_no = #{partNo}
  69. </if>
  70. <if test="wareHouseId != null and wareHouseId != ''">
  71. and ppi.ware_house_id = #{wareHouseId}
  72. </if>
  73. <if test="partdescription != null and partdescription != ''">
  74. and p.PartDescription like '%'+#{partdescription}+'%'
  75. </if>
  76. <if test="warehousename != null and warehousename != ''">
  77. and wh.WareHouseName like '%'+#{warehousename}+'%'
  78. </if>
  79. </where>
  80. </select>
  81. </mapper>