邱宇豪
2023-11-27 b79b3b5376bc5a54d897390718ddfee173c4eb32
hd/pipe/secure/src/main/resources/mapping/HiddenDangerMapper.xml
@@ -39,6 +39,9 @@
            <if test="integral != null">
                integral,
            </if>
            <if test="level != null">
                `level`,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -74,6 +77,9 @@
            </if>
            <if test="integral != null">
                #{integral,jdbcType=DOUBLE},
            </if>
            <if test="level != null">
                #{level,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
@@ -113,6 +119,10 @@
            <if test="integral != null">
                integral = #{integral,jdbcType=DOUBLE},
            </if>
            <if test="level != null">
                `level` = #{level,jdbcType=INTEGER},
            </if>
        </set>
        where id=#{id,jdbcType=VARCHAR}
    </update>
@@ -127,7 +137,8 @@
    <select id="selectInfo" resultType="com.thhy.secure.modules.biz.hiddenDanger.entity.HiddenDangerEntity">
        select
                t.id,
                t.dangerLocation,
                sd.dict_name dangerLocation,
                sd.dict_id dictId,
                t.title,
                t.createTime,
                t.auditStatus,
@@ -135,8 +146,14 @@
                t.createUser,
                t.updateUser,
                t.updateTime,
                t.companyId
                t.companyId,
                t.level,
                t.integral,
                su.real_name reporter
        from t_hidden_danger t
         LEFT JOIN sys_users su ON su.user_id = t.createUser
         LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser
         LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation
        where t.id=#{id}
    </select>
@@ -144,7 +161,8 @@
    <select id="selectPageList" resultType="com.thhy.secure.modules.biz.hiddenDanger.entity.HiddenDangerEntity">
        SELECT
                t.id,
                t.dangerLocation,
                sd.dict_name dangerLocation,
                sd.dict_id dictId,
                t.title,
                t.createTime,
                t.auditStatus,
@@ -152,19 +170,55 @@
                t.createUser,
                t.updateUser,
                t.updateTime,
                t.companyId
                t.companyId,
                t.level,
                t.integral,
                su.real_name reporter
         from t_hidden_danger t
         LEFT JOIN sys_users su ON su.user_id = t.createUser
         LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser
            LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation
        WHERE
            t.isUse = 1
            and t.companyId = #{companyId}
            <if test="startTime!= null and endTime!=null and startTime != '' and endTime !=''">
                and t.createTime BETWEEN #{startTime} and #{endTime}
            </if>
        order by t.createUser desc
        order by t.createTime desc
    </select>
    <!--查询列表-->
    <select id="selectAppList" resultType="com.thhy.secure.modules.biz.hiddenDanger.entity.HiddenDangerEntity">
        SELECT
            t.id,
            sd.dict_name dangerLocation,
            sd.dict_id dictId,
            t.title,
            t.createTime,
            t.auditStatus,
            t.isUse,
            t.createUser,
            t.updateUser,
            t.updateTime,
            t.companyId,
            t.level,
            t.integral,
            su.real_name reporter
        from t_hidden_danger t
        LEFT JOIN sys_users su ON su.user_id = t.createUser
        LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser
        LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation
        WHERE
        t.isUse = 1
        and t.companyId = #{companyId}
        <if test="startTime!= null and endTime!=null and startTime != '' and endTime !=''">
            and t.createTime BETWEEN #{startTime} and #{endTime}
        </if>
        ORDER BY
        t.auditStatus,
        case when t.auditStatus = 0 then t.createTime END,
        case when t.auditStatus = 1 then t.createTime END desc
    </select>
    <!--根据ID删除-->
    <delete id="deleteImg">
        delete from t_hidden_danger_img