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.
 
 
 
 
 
 

73 lines
3.2 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.PromotionHistMapper">
<resultMap id="BaseResultMap" type="com.xjfast.entity.PromotionHist">
<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="promotion_desc" jdbcType="VARCHAR" property="promotionDesc"/>
<result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
<result column="finish_date" jdbcType="TIMESTAMP" property="finishDate"/>
<result column="average_consume_qty" jdbcType="INTEGER" property="averageConsumeQty"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
</resultMap>
<insert id="savePromotionHistList" parameterType="collection">
INSERT INTO promotion_hist ( site, ware_house_id, part_no, promotion_desc, start_date, finish_date,
average_consume_qty, remark, created_date, created_by, status )
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.site},
#{item.wareHouseId},
#{item.partNo},
#{item.promotionDesc},
#{item.startDate},
#{item.finishDate},
#{item.averageConsumeQty},
#{item.remark},
#{item.createdDate},
#{item.createdBy},
#{item.status}
)
</foreach>
</insert>
<select id="searchPromotionHistList" resultType="com.xjfast.entity.vo.PromotionHistVo"
parameterType="com.xjfast.entity.query.PromotionHistQuery">
SELECT
ph.*,
p.PartDescription,
wh.WareHouseName
FROM
promotion_hist ph
LEFT JOIN part p ON ( ph.part_no = p.PartNo )
LEFT JOIN WareHouse wh ON ( wh.WareHouseID = ph.ware_house_id )
<where>
<if test="otherGroup2 != null and otherGroup2 != ''">
and p.OtherGroup2 = #{otherGroup2}
</if>
<if test="status != null and status != ''">
and ph.status = #{status}
</if>
<if test="site != null and site != ''">
and ph.site = #{site}
</if>
<if test="wareHouseName != null and wareHouseName != ''">
and wh.WareHouseName like '%'+#{wareHouseName}+'%'
</if>
<if test=" partDescription!= null and partDescription != ''">
and p.PartDescription like '%'+#{partDescription}+'%'
</if>
<if test=" wareHouseId!= null and wareHouseId != ''">
and ph.ware_house_id like '%'+#{wareHouseId}+'%'
</if>
<if test=" partNo!= null and partNo != ''">
and ph.part_no = #{partNo}
</if>
</where>
</select>
</mapper>