食堂项目功能修改

This commit is contained in:
2026-07-31 15:19:38 +08:00
parent dc68cda5d5
commit c42331c13e
9 changed files with 65 additions and 16 deletions

View File

@@ -81,7 +81,7 @@
left join food_spec d on a.spec_id=d.spec_id
left join food_unit e on a.unit_id=e.unit_id
left join supplier sup on a.supplier_id=sup.supplier_id
where b.repo_id=#{repoId} and a.del_flag=0
where b.repo_id=#{repoId} and a.del_flag=0 and b.food_product_num >0
</select>
<update id="updateDelFlag">

View File

@@ -6,14 +6,10 @@
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>
@@ -22,8 +18,6 @@
<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}
@@ -31,8 +25,17 @@
<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
select id, food_product_id foodProductId, repo_id repoId, food_product_num foodProductNum
from food_repo where food_product_id=#{productId} and repo_id=#{repoId}
</select>
<select id="selectByRepoId" resultType="FoodRepo">
select id, food_product_id foodProductId, repo_id repoId, food_product_num foodProductNum
from food_repo where repo_id in
<foreach collection="repoIds" item="repoId" index="index"
separator="," open="(" close=")">
#{repoId}
</foreach>
</select>
</mapper>

View File

@@ -25,7 +25,26 @@
</sql>
<select id="queryRepoList" resultType="com.zf.foodpurchase.fdsafe.vo.RepositoryVO"
parameterType="com.zf.foodpurchase.fdsafe.entity.Repository">
select r.id,r.merchant_id,r.repo_num,r.repo_name,r.area_code,r.detail_address,r.default_repo,r.create_time,r.update_time,r.oper_id,r.manager,r.order_num,d.dept_name merchant_name,count(fr.food_product_num) spCount,ifnull(sum(fr.food_product_num),0) wpCount,su.user_name managerName
select
r.id,
r.merchant_id,
r.repo_num,
r.repo_name,
r.area_code,
r.detail_address,
r.default_repo,
r.create_time,
r.update_time,
r.oper_id,
r.manager,
r.order_num,
d.dept_name merchant_name,
CASE
WHEN ifnull(sum(fr.food_product_num),0) = 0 THEN 0
ELSE count(fr.food_product_num)
END AS spCount,
ifnull(sum(fr.food_product_num),0) wpCount,
su.user_name managerName
from repository r
left join sys_dept d on r.merchant_id=d.dept_id
left join food_repo fr on r.id=fr.repo_id