<?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.landtool.lanbase.modules.res.dao.Res_ProblemFeedbackMapper">
|
<resultMap id="BaseResultMap" type="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
<id column="OBJECTID" property="objectid" jdbcType="INTEGER"/>
|
<result column="RESOURCEID" property="resourceid" jdbcType="INTEGER"/>
|
<result column="ADDTIME" property="addtime" jdbcType="TIMESTAMP"/>
|
<result column="REMARK" property="remark" jdbcType="VARCHAR"/>
|
<result column="CREATEUSERID" property="createuserid" jdbcType="INTEGER"/>
|
<result column="FEEDBACKTYPE" property="feedbacktype" jdbcType="VARCHAR"/>
|
<result column="FEEDBACKSTATUS" property="feedbackstatus" jdbcType="VARCHAR"/>
|
<result column="SERVERSTATUS" property="serverstatus" jdbcType="TINYINT"/>
|
</resultMap>
|
<sql id="Base_Column_List">
|
OBJECTID
|
, RESOURCEID, ADDTIME, REMARK, CREATEUSERID, FEEDBACKTYPE, FEEDBACKSTATUS,
|
SERVERSTATUS
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
select
|
<include refid="Base_Column_List"/>
|
from RES_PROBLEMFEEDBACK
|
where OBJECTID = #{objectid,jdbcType=INTEGER}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
delete
|
from RES_PROBLEMFEEDBACK
|
where OBJECTID = #{objectid,jdbcType=INTEGER}
|
</delete>
|
<insert id="insert" parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
insert into RES_PROBLEMFEEDBACK (OBJECTID, RESOURCEID, ADDTIME,
|
REMARK, CREATEUSERID, FEEDBACKTYPE,
|
FEEDBACKSTATUS, SERVERSTATUS)
|
values (#{objectid,jdbcType=INTEGER}, #{resourceid,jdbcType=INTEGER}, #{addtime,jdbcType=TIMESTAMP},
|
#{remark,jdbcType=VARCHAR}, #{createuserid,jdbcType=INTEGER}, #{feedbacktype,jdbcType=VARCHAR},
|
#{feedbackstatus,jdbcType=VARCHAR}, #{serverstatus,jdbcType=TINYINT})
|
</insert>
|
<insert id="insertSelective" parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
insert into RES_PROBLEMFEEDBACK
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="objectid != null">
|
OBJECTID,
|
</if>
|
<if test="resourceid != null">
|
RESOURCEID,
|
</if>
|
<if test="addtime != null">
|
ADDTIME,
|
</if>
|
<if test="remark != null">
|
REMARK,
|
</if>
|
<if test="createuserid != null">
|
CREATEUSERID,
|
</if>
|
<if test="feedbacktype != null">
|
FEEDBACKTYPE,
|
</if>
|
<if test="feedbackstatus != null">
|
FEEDBACKSTATUS,
|
</if>
|
<if test="serverstatus != null">
|
SERVERSTATUS,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="objectid != null">
|
#{objectid,jdbcType=INTEGER},
|
</if>
|
<if test="resourceid != null">
|
#{resourceid,jdbcType=INTEGER},
|
</if>
|
<if test="addtime != null">
|
#{addtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remark != null">
|
#{remark,jdbcType=VARCHAR},
|
</if>
|
<if test="createuserid != null">
|
#{createuserid,jdbcType=INTEGER},
|
</if>
|
<if test="feedbacktype != null">
|
#{feedbacktype,jdbcType=VARCHAR},
|
</if>
|
<if test="feedbackstatus != null">
|
#{feedbackstatus,jdbcType=VARCHAR},
|
</if>
|
<if test="serverstatus != null">
|
#{serverstatus,jdbcType=TINYINT},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective"
|
parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
update RES_PROBLEMFEEDBACK
|
<set>
|
<if test="resourceid != null">
|
RESOURCEID = #{resourceid,jdbcType=INTEGER},
|
</if>
|
<if test="addtime != null">
|
ADDTIME = #{addtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="remark != null">
|
REMARK = #{remark,jdbcType=VARCHAR},
|
</if>
|
<if test="createuserid != null">
|
CREATEUSERID = #{createuserid,jdbcType=INTEGER},
|
</if>
|
<if test="feedbacktype != null">
|
FEEDBACKTYPE = #{feedbacktype,jdbcType=VARCHAR},
|
</if>
|
<if test="feedbackstatus != null">
|
FEEDBACKSTATUS = #{feedbackstatus,jdbcType=VARCHAR},
|
</if>
|
<if test="serverstatus != null">
|
SERVERSTATUS = #{serverstatus,jdbcType=TINYINT},
|
</if>
|
</set>
|
where OBJECTID = #{objectid,jdbcType=INTEGER}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
update RES_PROBLEMFEEDBACK
|
set RESOURCEID = #{resourceid,jdbcType=INTEGER},
|
ADDTIME = #{addtime,jdbcType=TIMESTAMP},
|
REMARK = #{remark,jdbcType=VARCHAR},
|
CREATEUSERID = #{createuserid,jdbcType=INTEGER},
|
FEEDBACKTYPE = #{feedbacktype,jdbcType=VARCHAR},
|
FEEDBACKSTATUS = #{feedbackstatus,jdbcType=VARCHAR},
|
SERVERSTATUS = #{serverstatus,jdbcType=TINYINT}
|
where OBJECTID = #{objectid,jdbcType=INTEGER}
|
</update>
|
|
<select id="selectByResourceid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
select *
|
from RES_PROBLEMFEEDBACK
|
where RESOURCEID = #{resourceid}
|
order by ADDTIME desc
|
</select>
|
|
<select id="checkShowNormalBtn" resultMap="BaseResultMap">
|
|
WITH tab as(
|
select row_number() over(order by ADDTIME desc) rn,
|
a.* from RES_PROBLEMFEEDBACK a
|
<where>
|
<if test="resourceid != null">
|
and RESOURCEID = #{resourceid}
|
</if>
|
</where>
|
)
|
|
SELECT * from tab WHERE rn = 1
|
</select>
|
|
<select id="selectResProblemfeedback" parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback"
|
resultType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
select a.*,b.title from RES_PROBLEMFEEDBACK a left join RES_MAININFO b on a.RESOURCEID = b.RESOURCEID
|
<where>
|
b.title is not null
|
<if test="title!=null and title != '' ">
|
and (b.TITLE like ('%' || #{title} || '%') OR replace(KEYWORDS,',','') like ('%' || #{title} || '%'))
|
</if>
|
<if test="feedbackstatus != null and feedbackstatus != ''">
|
and a.feedbackstatus = #{feedbackstatus}
|
</if>
|
<if test="feedbacktype != null and feedbacktype != ''">
|
and a.feedbacktype = #{feedbacktype}
|
</if>
|
<if test="addtimeBeg != null and addtimeBeg != ''">
|
<![CDATA[ and a.addtime >= to_timestamp(#{addtimeBeg} || ' 00:00:00','yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="addtimeEnd != null and addtimeEnd != '' ">
|
<![CDATA[ and a.addtime <= to_timestamp(#{addtimeEnd} || ' 23:59:59','yyyy-mm-dd hh24:mi:ss') ]]>
|
</if>
|
<if test="existpermission !=null">
|
and b.CREATEUSERID=#{existpermission}
|
</if>
|
<if test="serverstatus != null">
|
and a.SERVERSTATUS = #{serverstatus}
|
</if>
|
</where>
|
order by a.addtime desc
|
</select>
|
|
<select id="selectTopByResourceid" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
WITH tab as (
|
select row_number() over(order by ADDTIME desc) rn, a.*
|
from RES_PROBLEMFEEDBACK a
|
where a.RESOURCEID = #{resourceid,jdbcType=INTEGER}
|
)
|
SELECT *
|
from tab
|
where rn = 1
|
|
</select>
|
|
<select id="getlatestalarm" resultType="map">
|
Select d.RESOURCEID,d.TIME ,H.TITLE,'异常' as SERVERSTATUS from (SELECT a.RESOURCEID, MAX(a.ADDTIME) as time from
|
RES_PROBLEMFEEDBACK a where a.SERVERSTATUS=1 group by a.RESOURCEID ) d INNER join RES_MAININFO H ON
|
H.RESOURCEID=D.RESOURCEID and H.RESOURCESTATUS=1 ORDER BY D.time desc
|
</select>
|
|
<update id="updateByResourceId" parameterType="com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback">
|
update RES_PROBLEMFEEDBACK
|
set
|
ADDTIME = #{addtime,jdbcType=TIMESTAMP}
|
<if test="serverstatus!=null and serverstatus!=''">
|
,SERVERSTATUS=#{serverstatus}
|
</if>
|
where OBJECTID = ( select tmp.* from (select b.*,row_number() over() as rownumber from (select OBJECTID from RES_PROBLEMFEEDBACK where RESOURCEID=#{resourceid,jdbcType=INTEGER} order by ADDTIME desc) b) tmp where rownumber=1)
|
</update>
|
</mapper>
|