|
@@ -0,0 +1,150 @@
|
|
|
+<?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.ruoyi.system.mapper.MenuFoodMapper">
|
|
|
+
|
|
|
+ <resultMap type="MenuFood" id="MenuFoodResult">
|
|
|
+ <result property="menuFoodId" column="menu_food_id"/>
|
|
|
+ <result property="menuFoodTime" column="menu_food_time"/>
|
|
|
+ <result property="menuFoodType" column="menu_food_type"/>
|
|
|
+ <result property="menuFoodDetailBk" column="menu_food_detail_bk"/>
|
|
|
+ <result property="menuFoodDetailLu" column="menu_food_detail_lu"/>
|
|
|
+ <result property="menuFoodDetailDi" column="menu_food_detail_di"/>
|
|
|
+ <result property="canteenName" column="canteen_name"/>
|
|
|
+ <result property="canteenId" column="canteen_id"/>
|
|
|
+ <result property="isUse" column="is_use"/>
|
|
|
+ <result property="createDept" column="create_dept"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMenuFoodVo">
|
|
|
+ select menu_food_id,
|
|
|
+ menu_food_time,
|
|
|
+ menu_food_type,
|
|
|
+ menu_food_detail_bk,
|
|
|
+ menu_food_detail_lu,
|
|
|
+ menu_food_detail_di,
|
|
|
+ canteen_name,
|
|
|
+ canteen_id,
|
|
|
+ is_use,
|
|
|
+ create_dept,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ remark
|
|
|
+ from menu_food
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMenuFoodList" parameterType="MenuFood" resultMap="MenuFoodResult">
|
|
|
+ <include refid="selectMenuFoodVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="menuFoodTime != null and menuFoodTime != ''">and menu_food_time = #{menuFoodTime}</if>
|
|
|
+ <if test="menuFoodType != null and menuFoodType != ''">and menu_food_type = #{menuFoodType}</if>
|
|
|
+ <if test="menuFoodDetailBk != null and menuFoodDetailBk != ''">and menu_food_detail_bk =
|
|
|
+ #{menuFoodDetailBk}
|
|
|
+ </if>
|
|
|
+ <if test="menuFoodDetailLu != null and menuFoodDetailLu != ''">and menu_food_detail_lu =
|
|
|
+ #{menuFoodDetailLu}
|
|
|
+ </if>
|
|
|
+ <if test="menuFoodDetailDi != null and menuFoodDetailDi != ''">and menu_food_detail_di =
|
|
|
+ #{menuFoodDetailDi}
|
|
|
+ </if>
|
|
|
+ <if test="canteenName != null and canteenName != ''">and canteen_name like concat('%', #{canteenName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="canteenId != null ">and canteen_id = #{canteenId}</if>
|
|
|
+ <if test="isUse != null and isUse != ''">and is_use = #{isUse}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMenuFoodByMenuFoodId" parameterType="Long" resultMap="MenuFoodResult">
|
|
|
+ <include refid="selectMenuFoodVo"/>
|
|
|
+ where menu_food_id = #{menuFoodId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMenuFood" parameterType="MenuFood" useGeneratedKeys="true" keyProperty="menuFoodId">
|
|
|
+ insert into menu_food
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="menuFoodTime != null">menu_food_time,</if>
|
|
|
+ <if test="menuFoodType != null">menu_food_type,</if>
|
|
|
+ <if test="menuFoodDetailBk != null">menu_food_detail_bk,</if>
|
|
|
+ <if test="menuFoodDetailLu != null">menu_food_detail_lu,</if>
|
|
|
+ <if test="menuFoodDetailDi != null">menu_food_detail_di,</if>
|
|
|
+ <if test="canteenName != null">canteen_name,</if>
|
|
|
+ <if test="canteenId != null">canteen_id,</if>
|
|
|
+ <if test="isUse != null">is_use,</if>
|
|
|
+ <if test="createDept != null">create_dept,</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>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="menuFoodTime != null">#{menuFoodTime},</if>
|
|
|
+ <if test="menuFoodType != null">#{menuFoodType},</if>
|
|
|
+ <if test="menuFoodDetailBk != null">#{menuFoodDetailBk},</if>
|
|
|
+ <if test="menuFoodDetailLu != null">#{menuFoodDetailLu},</if>
|
|
|
+ <if test="menuFoodDetailDi != null">#{menuFoodDetailDi},</if>
|
|
|
+ <if test="canteenName != null">#{canteenName},</if>
|
|
|
+ <if test="canteenId != null">#{canteenId},</if>
|
|
|
+ <if test="isUse != null">#{isUse},</if>
|
|
|
+ <if test="createDept != null">#{createDept},</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>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="batchMenuFoodVo">
|
|
|
+ insert into menu_food(menu_food_time, menu_food_detail_bk, menu_food_detail_lu, menu_food_detail_di, is_use,
|
|
|
+ create_time, remark) values
|
|
|
+ <foreach item="item" index="index" collection="list" separator=",">
|
|
|
+ (#{item.menuFoodTime},#{item.menuFoodDetailBk},#{item.menuFoodDetailLu},#{item.menuFoodDetailDi},#{item.isUse},sysdate(),#{item.remark})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+ <update id="updateMenuFood" parameterType="MenuFood">
|
|
|
+ update menu_food
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="menuFoodTime != null">menu_food_time = #{menuFoodTime},</if>
|
|
|
+ <if test="menuFoodType != null">menu_food_type = #{menuFoodType},</if>
|
|
|
+ <if test="menuFoodDetailBk != null">menu_food_detail_bk = #{menuFoodDetailBk},</if>
|
|
|
+ <if test="menuFoodDetailLu != null">menu_food_detail_lu = #{menuFoodDetailLu},</if>
|
|
|
+ <if test="menuFoodDetailDi != null">menu_food_detail_di = #{menuFoodDetailDi},</if>
|
|
|
+ <if test="canteenName != null">canteen_name = #{canteenName},</if>
|
|
|
+ <if test="canteenId != null">canteen_id = #{canteenId},</if>
|
|
|
+ <if test="isUse != null">is_use = #{isUse},</if>
|
|
|
+ <if test="createDept != null">create_dept = #{createDept},</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>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where menu_food_id = #{menuFoodId}
|
|
|
+ </update>
|
|
|
+ <update id="updateMenuFoodTime" parameterType="string">
|
|
|
+ update menu_food set is_use = 'N' where menu_food_time = #{menuFoodTime}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMenuFoodByMenuFoodId" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from menu_food
|
|
|
+ where menu_food_id = #{menuFoodId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMenuFoodByMenuFoodIds" parameterType="String">
|
|
|
+ delete from menu_food where menu_food_id in
|
|
|
+ <foreach item="menuFoodId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{menuFoodId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|