101 lines
6.0 KiB
XML
101 lines
6.0 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.kitchen.mapper.KitchenStaffInfoMapper">
|
||
|
|
<resultMap type="com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo" id="KitchenStaffInfoResult">
|
||
|
|
<result property="staffId" column="staff_id" />
|
||
|
|
<result property="staffNo" column="staff_no" />
|
||
|
|
<result property="userId" column="user_id" />
|
||
|
|
<result property="healthCertExpire" column="health_cert_expire" />
|
||
|
|
<result property="healthCertFrontImg" column="health_cert_front_img" />
|
||
|
|
<result property="healthCertBackImg" column="health_cert_back_img" />
|
||
|
|
<result property="nutrityCertExpire" column="nutrity_cert_expire" />
|
||
|
|
<result property="safetyCertExpire" column="safety_cert_expire" />
|
||
|
|
<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="selectKitchenStaffInfoVo">
|
||
|
|
select staff_id, staff_no, user_id, health_cert_expire, health_cert_front_img, health_cert_back_img, nutrity_cert_expire, safety_cert_expire, create_by, create_time, update_by, update_time from kitchen_staff_info
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectKitchenStaffInfoList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo" resultMap="KitchenStaffInfoResult">
|
||
|
|
<include refid="selectKitchenStaffInfoVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="staffNo != null and staffNo != ''"> and staff_no = #{staffNo}</if>
|
||
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||
|
|
<if test="healthCertExpire != null "> and health_cert_expire = #{healthCertExpire}</if>
|
||
|
|
<if test="healthCertFrontImg != null "> and health_cert_front_img = #{healthCertFrontImg}</if>
|
||
|
|
<if test="healthCertBackImg != null "> and health_cert_back_img = #{healthCertBackImg}</if>
|
||
|
|
<if test="nutrityCertExpire != null "> and nutrity_cert_expire = #{nutrityCertExpire}</if>
|
||
|
|
<if test="safetyCertExpire != null "> and safety_cert_expire = #{safetyCertExpire}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectKitchenStaffInfoByStaffId" parameterType="Long" resultMap="KitchenStaffInfoResult">
|
||
|
|
<include refid="selectKitchenStaffInfoVo"/>
|
||
|
|
where staff_id = #{staffId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertKitchenStaffInfo" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo" useGeneratedKeys="true" keyProperty="staffId">
|
||
|
|
insert into kitchen_staff_info
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="staffNo != null and staffNo != ''">staff_no,</if>
|
||
|
|
<if test="userId != null">user_id,</if>
|
||
|
|
<if test="healthCertExpire != null">health_cert_expire,</if>
|
||
|
|
<if test="healthCertFrontImg != null">health_cert_front_img,</if>
|
||
|
|
<if test="healthCertBackImg != null">health_cert_back_img,</if>
|
||
|
|
<if test="nutrityCertExpire != null">nutrity_cert_expire,</if>
|
||
|
|
<if test="safetyCertExpire != null">safety_cert_expire,</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="staffNo != null and staffNo != ''">#{staffNo},</if>
|
||
|
|
<if test="userId != null">#{userId},</if>
|
||
|
|
<if test="healthCertExpire != null">#{healthCertExpire},</if>
|
||
|
|
<if test="healthCertFrontImg != null">#{healthCertFrontImg},</if>
|
||
|
|
<if test="healthCertBackImg != null">#{healthCertBackImg},</if>
|
||
|
|
<if test="nutrityCertExpire != null">#{nutrityCertExpire},</if>
|
||
|
|
<if test="safetyCertExpire != null">#{safetyCertExpire},</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="updateKitchenStaffInfo" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffInfo">
|
||
|
|
update kitchen_staff_info
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="staffNo != null and staffNo != ''">staff_no = #{staffNo},</if>
|
||
|
|
<if test="userId != null">user_id = #{userId},</if>
|
||
|
|
<if test="healthCertExpire != null">health_cert_expire = #{healthCertExpire},</if>
|
||
|
|
<if test="healthCertFrontImg != null">health_cert_front_img = #{healthCertFrontImg},</if>
|
||
|
|
<if test="healthCertBackImg != null">health_cert_back_img = #{healthCertBackImg},</if>
|
||
|
|
<if test="nutrityCertExpire != null">nutrity_cert_expire = #{nutrityCertExpire},</if>
|
||
|
|
<if test="safetyCertExpire != null">safety_cert_expire = #{safetyCertExpire},</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 staff_id = #{staffId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteKitchenStaffInfoByStaffId" parameterType="Long">
|
||
|
|
delete from kitchen_staff_info where staff_id = #{staffId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteKitchenStaffInfoByStaffIds" parameterType="String">
|
||
|
|
delete from kitchen_staff_info where staff_id in
|
||
|
|
<foreach item="staffId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{staffId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|