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.

72 lines
3.2 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.PromotionHistMapper">
  4. <resultMap id="BaseResultMap" type="com.xjfast.entity.PromotionHist">
  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="promotion_desc" jdbcType="VARCHAR" property="promotionDesc"/>
  10. <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
  11. <result column="finish_date" jdbcType="TIMESTAMP" property="finishDate"/>
  12. <result column="average_consume_qty" jdbcType="INTEGER" property="averageConsumeQty"/>
  13. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  14. <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
  15. <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
  16. </resultMap>
  17. <insert id="savePromotionHistList" parameterType="collection">
  18. INSERT INTO promotion_hist ( site, ware_house_id, part_no, promotion_desc, start_date, finish_date,
  19. average_consume_qty, remark, created_date, created_by, status )
  20. VALUES
  21. <foreach collection="list" item="item" index="index" separator=",">
  22. (
  23. #{item.site},
  24. #{item.wareHouseId},
  25. #{item.partNo},
  26. #{item.promotionDesc},
  27. #{item.startDate},
  28. #{item.finishDate},
  29. #{item.averageConsumeQty},
  30. #{item.remark},
  31. #{item.createdDate},
  32. #{item.createdBy},
  33. #{item.status}
  34. )
  35. </foreach>
  36. </insert>
  37. <select id="searchPromotionHistList" resultType="com.xjfast.entity.vo.PromotionHistVo"
  38. parameterType="com.xjfast.entity.query.PromotionHistQuery">
  39. SELECT
  40. ph.*,
  41. p.PartDescription,
  42. wh.WareHouseName
  43. FROM
  44. promotion_hist ph
  45. LEFT JOIN part p ON ( ph.part_no = p.PartNo )
  46. LEFT JOIN WareHouse wh ON ( wh.WareHouseID = ph.ware_house_id )
  47. <where>
  48. <if test="otherGroup2 != null and otherGroup2 != ''">
  49. and p.OtherGroup2 = #{otherGroup2}
  50. </if>
  51. <if test="status != null and status != ''">
  52. and ph.status = #{status}
  53. </if>
  54. <if test="site != null and site != ''">
  55. and ph.site = #{site}
  56. </if>
  57. <if test="wareHouseName != null and wareHouseName != ''">
  58. and wh.WareHouseName like '%'+#{wareHouseName}+'%'
  59. </if>
  60. <if test=" partDescription!= null and partDescription != ''">
  61. and p.PartDescription like '%'+#{partDescription}+'%'
  62. </if>
  63. <if test=" wareHouseId!= null and wareHouseId != ''">
  64. and ph.ware_house_id like '%'+#{wareHouseId}+'%'
  65. </if>
  66. <if test=" partNo!= null and partNo != ''">
  67. and ph.part_no = #{partNo}
  68. </if>
  69. </where>
  70. </select>
  71. </mapper>