<?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.docking.mapper.SmartRemindersMapper">

    <select id="page" resultType="com.ruoyi.docking.entity.SmartReminders">
        select a.*
        from gysl_smart_reminders a
        <where>
            <if test="req.rulesName != null and req.rulesName != '' ">
                and a.rules_name like concat('%',#{req.rulesName},'%')
            </if>
            <if test="req.alertType != null and req.alertType != '' ">
                and a.alert_type = #{req.alertType}
            </if>
        </where>
        order by a.create_time desc
    </select>
    <insert id="addJobSmart">
        insert into gysl_job_smart (smart_id,job_id) values (#{req.smartId},#{req.jobId})
    </insert>
    <select id="selectJobSmart" resultType="com.ruoyi.docking.entity.request.JAddJobSmart">
        select * from gysl_job_smart where smart_id = #{id}
    </select>
    <update id="isRead">
        update gysl_smart_declaration set is_read = 2 where id = #{id}
    </update>
</mapper>
