fuliqi
2024-09-04 cc511acb919f842e95c2f6027f4fc4429c7b7b1a
ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml
@@ -27,7 +27,8 @@
        FROM t_image_resource_security_detail
    </sql>
    <select id="selectImageResourceSecurityDetailList" resultType="com.ycl.platform.domain.entity.ImageResourceSecurityDetail">
    <select id="selectImageResourceSecurityDetailList"
            resultType="com.ycl.platform.domain.entity.ImageResourceSecurityDetail">
        select id,
        ip,
        a.dept_id,
@@ -40,12 +41,14 @@
        from t_image_resource_security_detail a
        LEFT JOIN sys_dept b ON a.dept_id = b.dept_id AND b.del_flag = 0
        <where>
            <if test="ip != null  and ip != ''">and ip = #{ip}</if>
            <if test="deptId != null ">and a.dept_id = #{deptId}</if>
            <if test="alarmCategory != null  and alarmCategory != ''">and alarm_category = #{alarmCategory}</if>
            <if test="alarmLevel != null ">and alarm_level = #{alarmLevel}</if>
            <if test="num != null ">and num = #{num}</if>
            <if test="alarmTime != null ">and alarm_time = #{alarmTime}</if>
            <if test="startTime!=null and endTime!=null">
                and a.alarm_time between #{startTime} and #{endTime}
            </if>
            <if test="keyword!=null and keyword!=''">
                and (b.dept_name like concat('%',#{keyword},'%') or
                a.ip like concat('%',#{keyword},'%')
                )
            </if>
        </where>
    </select>
@@ -78,9 +81,11 @@
    </insert>
    <insert id="saveBatch">
        INSERT INTO t_image_resource_security_detail (ip, dept_id, alarm_category, alarm_level, num, alarm_time, create_time) VALUES
        INSERT INTO t_image_resource_security_detail (ip, dept_id, alarm_category, alarm_level, num, alarm_time,
        create_time) VALUES
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.ip}, #{item.deptId}, #{item.alarmCategory}, #{item.alarmLevel}, #{item.num}, #{item.alarmTime}, NOW())
            (#{item.ip}, #{item.deptId}, #{item.alarmCategory}, #{item.alarmLevel}, #{item.num}, #{item.alarmTime},
            NOW())
        </foreach>
    </insert>