食品采购出入库
This commit is contained in:
38
fp-system/src/main/resources/mapper/FoodRepoMapper.xml
Normal file
38
fp-system/src/main/resources/mapper/FoodRepoMapper.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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.zf.foodpurchase.fdsafe.mapper.FoodRepoMapper">
|
||||
|
||||
<insert id="insert" parameterType="FoodRepo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into food_repo(
|
||||
<if test="foodProductId != null">food_product_id,</if>
|
||||
<if test="repoId != null">repo_id,</if>
|
||||
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||
<if test="orderItemNo != null and orderItemNo != ''">order_item_no,</if>
|
||||
<if test="foodProductNum != null">food_product_num</if>
|
||||
)values(
|
||||
<if test="foodProductId != null">#{foodProductId},</if>
|
||||
<if test="repoId != null">#{repoId},</if>
|
||||
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||
<if test="orderItemNo != null and orderItemNo != ''">#{orderItemNo},</if>
|
||||
<if test="foodProductNum != null">#{foodProductNum}</if>)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update food_repo
|
||||
<set>
|
||||
<if test="foodProductId != null">food_product_id=#{foodProductId},</if>
|
||||
<if test="repoId != null">repo_id=#{repoId},</if>
|
||||
<if test="orderNo != null and orderNo != ''">order_no=#{orderNo},</if>
|
||||
<if test="orderItemNo != null and orderItemNo != ''">order_item_no=#{orderItemNo},</if>
|
||||
<if test="foodProductNum != null">food_product_num=#{foodProductNum}</if>
|
||||
</set>
|
||||
where id=#{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectByProductIdAndRepoId" resultType="FoodRepo">
|
||||
select id, food_product_id foodProductId, repo_id repoId, order_no orderNo, order_item_no orderItemNo, food_product_num foodProductNum
|
||||
from food_repo where food_product_id=#{productId} and repo_id=#{repoId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user