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.
88 lines
3.4 KiB
88 lines
3.4 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.PartPlanInfoMapper">
|
|
<resultMap id="BaseResultMap" type="com.xjfast.entity.PartPlanInfo">
|
|
<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="cover_days" jdbcType="INTEGER" property="coverDays"/>
|
|
<result column="average_consume_qty" jdbcType="VARCHAR" property="averageConsumeQty"/>
|
|
</resultMap>
|
|
<insert id="savePartPlanInfoList" parameterType="collection">
|
|
INSERT INTO part_plan_info ( site, ware_house_id, part_no, cover_days,average_consume_qty, ware_house_type )
|
|
VALUES
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
(
|
|
#{item.site},
|
|
#{item.wareHouseId},
|
|
#{item.partNo},
|
|
#{item.coverDays},
|
|
#{item.averageConsumeQty},
|
|
#{item.wareHouseType}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
<delete id="deletePartPlanInfo" parameterType="collection">
|
|
DELETE part_plan_info
|
|
<where>
|
|
<foreach open=" id in ( " close=" )" collection="list" item="item" index="index" separator=",">
|
|
#{item.id}
|
|
</foreach>
|
|
</where>
|
|
</delete>
|
|
|
|
<select id="searchPartPlanInfoList" resultType="com.xjfast.entity.vo.PartPlanInfoVo"
|
|
parameterType="com.xjfast.entity.query.PartPlanInfoQuery">
|
|
SELECT
|
|
ppi.id,
|
|
p.site,
|
|
p.PartNo as partNo,
|
|
p.OtherGroup2,
|
|
p.DefaultWarehouseID,
|
|
ppi.cover_days,
|
|
ppi.average_consume_qty,
|
|
p.PartDescription,
|
|
wh.WareHouseName,
|
|
p.DefaultWarehouseID as wareHouseId,
|
|
ppi.ware_house_type
|
|
FROM
|
|
part p
|
|
LEFT JOIN part_plan_info ppi ON ( p.PartNo = ppi.part_no AND p.Site = ppi.site )
|
|
LEFT JOIN WareHouse wh ON ( wh.WareHouseID = p.DefaultWarehouseID )
|
|
<where>
|
|
<if test="operating == 0 ">
|
|
|
|
ppi.cover_days is not null
|
|
AND ppi.average_consume_qty is not null
|
|
</if>
|
|
<if test="operating == 1">
|
|
|
|
ppi.cover_days is null
|
|
AND ppi.average_consume_qty is null
|
|
</if>
|
|
<if test="wareHouseTypeDb != '' and wareHouseTypeDb != null">
|
|
|
|
AND ppi.ware_house_type = #{wareHouseTypeDb}
|
|
</if>
|
|
|
|
<if test="othergroup2 != '' and othergroup2 != null">
|
|
|
|
AND p.OtherGroup2 = #{othergroup2}
|
|
</if>
|
|
<if test="partNo != null and partNo != ''">
|
|
AND ppi.part_no = #{partNo}
|
|
</if>
|
|
<if test="wareHouseId != null and wareHouseId != ''">
|
|
and ppi.ware_house_id = #{wareHouseId}
|
|
</if>
|
|
<if test="partdescription != null and partdescription != ''">
|
|
and p.PartDescription like '%'+#{partdescription}+'%'
|
|
</if>
|
|
<if test="warehousename != null and warehousename != ''">
|
|
and wh.WareHouseName like '%'+#{warehousename}+'%'
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
</mapper>
|