| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.OperatingHoursMapper">
-
- <resultMap type="OperatingHours" id="OperatingHoursResult">
- <result property="id" column="id" />
- <result property="mdId" column="md_id" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- </resultMap>
- <sql id="selectOperatingHoursVo">
- select id, md_id, start_time, end_time from operating_hours
- </sql>
- <select id="selectOperatingHoursList" parameterType="OperatingHours" resultMap="OperatingHoursResult">
- <include refid="selectOperatingHoursVo"/>
- <where>
- <if test="id != null "> and id = #{id}</if>
- <if test="mdId != null "> and md_id = #{mdId}</if>
- </where>
- </select>
-
- <select id="selectOperatingHoursById" parameterType="Long" resultMap="OperatingHoursResult">
- <include refid="selectOperatingHoursVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertOperatingHours" parameterType="OperatingHours" useGeneratedKeys="true" keyProperty="id">
- insert into operating_hours
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="mdId != null">md_id,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="mdId != null">#{mdId},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- </trim>
- </insert>
- <update id="updateOperatingHours" parameterType="OperatingHours">
- update operating_hours
- <trim prefix="SET" suffixOverrides=",">
- <if test="mdId != null">md_id = #{mdId},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteOperatingHoursById" parameterType="Long">
- delete from operating_hours where id = #{id}
- </delete>
- <delete id="deleteOperatingHoursByIds" parameterType="String">
- delete from operating_hours where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|