159 lines
10 KiB
XML
159 lines
10 KiB
XML
|
|
<?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.bonus.canteen.core.ims.mapper.PurchasePlanMapper">
|
||
|
|
<resultMap type="com.bonus.canteen.core.ims.domain.PurchasePlan" id="PurchasePlanResult">
|
||
|
|
<result property="planId" column="plan_id" />
|
||
|
|
<result property="planCode" column="plan_code" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="purchaseDate" column="purchase_date" />
|
||
|
|
<result property="purchaseUserId" column="purchase_user_id" />
|
||
|
|
<result property="productionPlanId" column="production_plan_id" />
|
||
|
|
<result property="approveStatus" column="approve_status" />
|
||
|
|
<result property="processInstanceId" column="process_instance_id" />
|
||
|
|
<result property="relatePlanIds" column="relate_plan_ids" />
|
||
|
|
<result property="canteenId" column="canteen_id" />
|
||
|
|
<result property="stallId" column="stall_id" />
|
||
|
|
<result property="purchaseBudgetTotal" column="purchase_budget_total" />
|
||
|
|
<result property="supplierIds" column="supplier_ids" />
|
||
|
|
<result property="approveBy" column="approve_by" />
|
||
|
|
<result property="approveTime" column="approve_time" />
|
||
|
|
<result property="approveRemark" column="approve_remark" />
|
||
|
|
<result property="ifMerge" column="if_merge" />
|
||
|
|
<result property="deliverGoodsDate" column="deliver_goods_date" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
<result property="delFlag" column="del_flag" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectPurchasePlanVo">
|
||
|
|
select plan_id, plan_code, status, purchase_date, purchase_user_id, production_plan_id, approve_status, process_instance_id, relate_plan_ids, canteen_id, stall_id, purchase_budget_total, supplier_ids, approve_by, approve_time, approve_remark, if_merge, deliver_goods_date, remark, del_flag, create_by, create_time, update_by, update_time from ims_purchase_plan
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectPurchasePlanList" parameterType="com.bonus.canteen.core.ims.domain.PurchasePlan" resultMap="PurchasePlanResult">
|
||
|
|
<include refid="selectPurchasePlanVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||
|
|
<if test="status != null "> and status = #{status}</if>
|
||
|
|
<if test="purchaseDate != null "> and purchase_date = #{purchaseDate}</if>
|
||
|
|
<if test="purchaseUserId != null "> and purchase_user_id = #{purchaseUserId}</if>
|
||
|
|
<if test="productionPlanId != null and productionPlanId != ''"> and production_plan_id = #{productionPlanId}</if>
|
||
|
|
<if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
|
||
|
|
<if test="processInstanceId != null "> and process_instance_id = #{processInstanceId}</if>
|
||
|
|
<if test="relatePlanIds != null and relatePlanIds != ''"> and relate_plan_ids = #{relatePlanIds}</if>
|
||
|
|
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||
|
|
<if test="stallId != null and stallId != ''"> and stall_id = #{stallId}</if>
|
||
|
|
<if test="purchaseBudgetTotal != null "> and purchase_budget_total = #{purchaseBudgetTotal}</if>
|
||
|
|
<if test="supplierIds != null and supplierIds != ''"> and supplier_ids = #{supplierIds}</if>
|
||
|
|
<if test="approveBy != null and approveBy != ''"> and approve_by = #{approveBy}</if>
|
||
|
|
<if test="approveTime != null "> and approve_time = #{approveTime}</if>
|
||
|
|
<if test="approveRemark != null and approveRemark != ''"> and approve_remark = #{approveRemark}</if>
|
||
|
|
<if test="ifMerge != null "> and if_merge = #{ifMerge}</if>
|
||
|
|
<if test="deliverGoodsDate != null "> and deliver_goods_date = #{deliverGoodsDate}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectPurchasePlanByPlanId" parameterType="Long" resultMap="PurchasePlanResult">
|
||
|
|
<include refid="selectPurchasePlanVo"/>
|
||
|
|
where plan_id = #{planId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertPurchasePlan" parameterType="com.bonus.canteen.core.ims.domain.PurchasePlan" useGeneratedKeys="true" keyProperty="planId">
|
||
|
|
insert into ims_purchase_plan
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||
|
|
<if test="status != null">status,</if>
|
||
|
|
<if test="purchaseDate != null">purchase_date,</if>
|
||
|
|
<if test="purchaseUserId != null">purchase_user_id,</if>
|
||
|
|
<if test="productionPlanId != null">production_plan_id,</if>
|
||
|
|
<if test="approveStatus != null">approve_status,</if>
|
||
|
|
<if test="processInstanceId != null">process_instance_id,</if>
|
||
|
|
<if test="relatePlanIds != null">relate_plan_ids,</if>
|
||
|
|
<if test="canteenId != null">canteen_id,</if>
|
||
|
|
<if test="stallId != null">stall_id,</if>
|
||
|
|
<if test="purchaseBudgetTotal != null">purchase_budget_total,</if>
|
||
|
|
<if test="supplierIds != null">supplier_ids,</if>
|
||
|
|
<if test="approveBy != null">approve_by,</if>
|
||
|
|
<if test="approveTime != null">approve_time,</if>
|
||
|
|
<if test="approveRemark != null">approve_remark,</if>
|
||
|
|
<if test="ifMerge != null">if_merge,</if>
|
||
|
|
<if test="deliverGoodsDate != null">deliver_goods_date,</if>
|
||
|
|
<if test="remark != null">remark,</if>
|
||
|
|
<if test="delFlag != null">del_flag,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateBy != null">update_by,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||
|
|
<if test="status != null">#{status},</if>
|
||
|
|
<if test="purchaseDate != null">#{purchaseDate},</if>
|
||
|
|
<if test="purchaseUserId != null">#{purchaseUserId},</if>
|
||
|
|
<if test="productionPlanId != null">#{productionPlanId},</if>
|
||
|
|
<if test="approveStatus != null">#{approveStatus},</if>
|
||
|
|
<if test="processInstanceId != null">#{processInstanceId},</if>
|
||
|
|
<if test="relatePlanIds != null">#{relatePlanIds},</if>
|
||
|
|
<if test="canteenId != null">#{canteenId},</if>
|
||
|
|
<if test="stallId != null">#{stallId},</if>
|
||
|
|
<if test="purchaseBudgetTotal != null">#{purchaseBudgetTotal},</if>
|
||
|
|
<if test="supplierIds != null">#{supplierIds},</if>
|
||
|
|
<if test="approveBy != null">#{approveBy},</if>
|
||
|
|
<if test="approveTime != null">#{approveTime},</if>
|
||
|
|
<if test="approveRemark != null">#{approveRemark},</if>
|
||
|
|
<if test="ifMerge != null">#{ifMerge},</if>
|
||
|
|
<if test="deliverGoodsDate != null">#{deliverGoodsDate},</if>
|
||
|
|
<if test="remark != null">#{remark},</if>
|
||
|
|
<if test="delFlag != null">#{delFlag},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updatePurchasePlan" parameterType="com.bonus.canteen.core.ims.domain.PurchasePlan">
|
||
|
|
update ims_purchase_plan
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||
|
|
<if test="status != null">status = #{status},</if>
|
||
|
|
<if test="purchaseDate != null">purchase_date = #{purchaseDate},</if>
|
||
|
|
<if test="purchaseUserId != null">purchase_user_id = #{purchaseUserId},</if>
|
||
|
|
<if test="productionPlanId != null">production_plan_id = #{productionPlanId},</if>
|
||
|
|
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
||
|
|
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||
|
|
<if test="relatePlanIds != null">relate_plan_ids = #{relatePlanIds},</if>
|
||
|
|
<if test="canteenId != null">canteen_id = #{canteenId},</if>
|
||
|
|
<if test="stallId != null">stall_id = #{stallId},</if>
|
||
|
|
<if test="purchaseBudgetTotal != null">purchase_budget_total = #{purchaseBudgetTotal},</if>
|
||
|
|
<if test="supplierIds != null">supplier_ids = #{supplierIds},</if>
|
||
|
|
<if test="approveBy != null">approve_by = #{approveBy},</if>
|
||
|
|
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
||
|
|
<if test="approveRemark != null">approve_remark = #{approveRemark},</if>
|
||
|
|
<if test="ifMerge != null">if_merge = #{ifMerge},</if>
|
||
|
|
<if test="deliverGoodsDate != null">deliver_goods_date = #{deliverGoodsDate},</if>
|
||
|
|
<if test="remark != null">remark = #{remark},</if>
|
||
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
where plan_id = #{planId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deletePurchasePlanByPlanId" parameterType="Long">
|
||
|
|
delete from ims_purchase_plan where plan_id = #{planId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deletePurchasePlanByPlanIds" parameterType="String">
|
||
|
|
delete from ims_purchase_plan where plan_id in
|
||
|
|
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{planId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|