Bonus-Cloud-JYY-Smart-Canteen/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/kitchen/KitchenStaffIllegalWarningM...

148 lines
9.0 KiB
XML
Raw Normal View History

2025-06-16 18:40:41 +08:00
<?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.KitchenStaffIllegalWarningMapper">
<resultMap type="com.bonus.canteen.core.kitchen.domain.KitchenStaffIllegalWarning" id="KitchenStaffIllegalWarningResult">
<result property="illegalWarningId" column="illegal_warning_id" />
<result property="staffId" column="staff_id" />
<result property="deviceId" column="device_id" />
<result property="imgUrl" column="img_url" />
<result property="recordDesc" column="record_desc" />
<result property="recordTime" column="record_time" />
<result property="illegalWarningType" column="illegal_warning_type" />
<result property="handleState" column="handle_state" />
<result property="handleTime" column="handle_time" />
<result property="handlerPerson" column="handler_person" />
<result property="notifyState" column="notify_state" />
<result property="notifyDesc" column="notify_desc" />
<result property="alarmType" column="alarm_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
2025-06-23 14:40:02 +08:00
<result property="staffName" column="staff_name" />
<result property="staffNo" column="staff_no" />
2025-06-18 15:49:00 +08:00
<result property="canteenName" column="canteen_name" />
2025-06-16 18:40:41 +08:00
</resultMap>
<sql id="selectKitchenStaffIllegalWarningVo">
2025-06-18 15:49:00 +08:00
select illegal_warning_id, ksiw.staff_id, device_id, ksiw.img_url, record_desc, record_time,
illegal_warning_type, handle_state, handle_time, handler_person, notify_state,
notify_desc, alarm_type, ksiw.create_by, ksiw.create_time, ksiw.update_by, ksiw.update_time,
2025-06-23 14:40:02 +08:00
ksi.staff_name, ksi.staff_no, bc.canteen_name
2025-06-18 15:49:00 +08:00
from kitchen_staff_illegal_warning ksiw
left join kitchen_staff_info ksi on ksiw.staff_id = ksi.staff_id
left join basic_canteen bc on bc.canteen_id = ksi.canteen_id
2025-06-16 18:40:41 +08:00
</sql>
<select id="selectKitchenStaffIllegalWarningList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffIllegalWarning" resultMap="KitchenStaffIllegalWarningResult">
<include refid="selectKitchenStaffIllegalWarningVo"/>
<where>
2025-06-18 15:49:00 +08:00
<if test="staffId != null "> and ksiw.staff_id = #{staffId}</if>
2025-06-16 18:40:41 +08:00
<if test="deviceId != null "> and device_id = #{deviceId}</if>
2025-06-18 15:49:00 +08:00
<if test="imgUrl != null and imgUrl != ''"> and ksiw.img_url = #{imgUrl}</if>
<if test="recordDesc != null and recordDesc != ''"> and record_desc like CONCAT('%',#{recordDesc},'%')</if>
2025-06-16 18:40:41 +08:00
<if test="recordTime != null "> and record_time = #{recordTime}</if>
<if test="illegalWarningType != null "> and illegal_warning_type = #{illegalWarningType}</if>
<if test="handleState != null "> and handle_state = #{handleState}</if>
<if test="handleTime != null "> and handle_time = #{handleTime}</if>
<if test="handlerPerson != null and handlerPerson != ''"> and handler_person = #{handlerPerson}</if>
<if test="notifyState != null "> and notify_state = #{notifyState}</if>
<if test="notifyDesc != null and notifyDesc != ''"> and notify_desc = #{notifyDesc}</if>
<if test="alarmType != null "> and alarm_type = #{alarmType}</if>
2025-06-18 15:49:00 +08:00
<if test="searchValue != null and searchValue != ''">
2025-06-23 14:40:02 +08:00
and (ksi.staff_name like CONCAT('%',#{searchValue},'%')
or ksi.mobile like CONCAT('%',#{searchValue},'%')
or ksi.staff_no like CONCAT('%',#{searchValue},'%')
2025-06-18 15:49:00 +08:00
)
</if>
<if test="startDateTime != null">
2025-06-18 17:41:22 +08:00
and ksiw.record_time <![CDATA[ >= ]]> #{startDateTime}
2025-06-18 15:49:00 +08:00
</if>
<if test="endDateTime != null">
2025-06-18 17:41:22 +08:00
and ksiw.record_time <![CDATA[ <= ]]> #{endDateTime}
2025-06-18 15:49:00 +08:00
</if>
2025-06-16 18:40:41 +08:00
</where>
2025-06-20 16:38:38 +08:00
order by ksiw.record_time desc
2025-06-16 18:40:41 +08:00
</select>
<select id="selectKitchenStaffIllegalWarningByIllegalWarningId" parameterType="Long" resultMap="KitchenStaffIllegalWarningResult">
<include refid="selectKitchenStaffIllegalWarningVo"/>
where illegal_warning_id = #{illegalWarningId}
</select>
<insert id="insertKitchenStaffIllegalWarning" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffIllegalWarning" useGeneratedKeys="true" keyProperty="illegalWarningId">
insert into kitchen_staff_illegal_warning
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="staffId != null">staff_id,</if>
<if test="deviceId != null">device_id,</if>
<if test="imgUrl != null and imgUrl != ''">img_url,</if>
<if test="recordDesc != null and recordDesc != ''">record_desc,</if>
<if test="recordTime != null">record_time,</if>
<if test="illegalWarningType != null">illegal_warning_type,</if>
<if test="handleState != null">handle_state,</if>
<if test="handleTime != null">handle_time,</if>
<if test="handlerPerson != null">handler_person,</if>
<if test="notifyState != null">notify_state,</if>
<if test="notifyDesc != null">notify_desc,</if>
<if test="alarmType != null">alarm_type,</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="staffId != null">#{staffId},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
<if test="recordDesc != null and recordDesc != ''">#{recordDesc},</if>
<if test="recordTime != null">#{recordTime},</if>
<if test="illegalWarningType != null">#{illegalWarningType},</if>
<if test="handleState != null">#{handleState},</if>
<if test="handleTime != null">#{handleTime},</if>
<if test="handlerPerson != null">#{handlerPerson},</if>
<if test="notifyState != null">#{notifyState},</if>
<if test="notifyDesc != null">#{notifyDesc},</if>
<if test="alarmType != null">#{alarmType},</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="updateKitchenStaffIllegalWarning" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenStaffIllegalWarning">
update kitchen_staff_illegal_warning
<trim prefix="SET" suffixOverrides=",">
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
<if test="recordDesc != null and recordDesc != ''">record_desc = #{recordDesc},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="illegalWarningType != null">illegal_warning_type = #{illegalWarningType},</if>
<if test="handleState != null">handle_state = #{handleState},</if>
<if test="handleTime != null">handle_time = #{handleTime},</if>
<if test="handlerPerson != null">handler_person = #{handlerPerson},</if>
<if test="notifyState != null">notify_state = #{notifyState},</if>
<if test="notifyDesc != null">notify_desc = #{notifyDesc},</if>
<if test="alarmType != null">alarm_type = #{alarmType},</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 illegal_warning_id = #{illegalWarningId}
</update>
<delete id="deleteKitchenStaffIllegalWarningByIllegalWarningId" parameterType="Long">
delete from kitchen_staff_illegal_warning where illegal_warning_id = #{illegalWarningId}
</delete>
<delete id="deleteKitchenStaffIllegalWarningByIllegalWarningIds" parameterType="String">
delete from kitchen_staff_illegal_warning where illegal_warning_id in
<foreach item="illegalWarningId" collection="array" open="(" separator="," close=")">
#{illegalWarningId}
</foreach>
</delete>
</mapper>