|
@@ -5,133 +5,143 @@
|
|
|
<mapper namespace="com.jjt.push.mapper.PushRecordMapper">
|
|
|
|
|
|
<resultMap type="PushRecord" id="PushRecordResult">
|
|
|
- <result property="prId" column="PR_ID"/>
|
|
|
- <result property="pushType" column="PUSH_TYPE"/>
|
|
|
- <result property="alarmLevel" column="ALARM_LEVEL"/>
|
|
|
- <result property="sendObj" column="SEND_OBJ"/>
|
|
|
- <result property="sendTitle" column="SEND_TITLE"/>
|
|
|
- <result property="sendContent" column="SEND_CONTENT"/>
|
|
|
- <result property="sendSuccess" column="SEND_SUCCESS"/>
|
|
|
- <result property="sendTime" column="SEND_TIME"/>
|
|
|
- <result property="remark" column="REMARK"/>
|
|
|
+ <result property="prId" column="PR_ID"/>
|
|
|
+ <result property="pushType" column="PUSH_TYPE"/>
|
|
|
+ <result property="alarmLevel" column="ALARM_LEVEL"/>
|
|
|
+ <result property="sendObj" column="SEND_OBJ"/>
|
|
|
+ <result property="sendTitle" column="SEND_TITLE"/>
|
|
|
+ <result property="sendContent" column="SEND_CONTENT"/>
|
|
|
+ <result property="sendSuccess" column="SEND_SUCCESS"/>
|
|
|
+ <result property="sendTime" column="SEND_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectPushRecordVo">
|
|
|
- select PR_ID, PUSH_TYPE, ALARM_LEVEL, SEND_OBJ, SEND_TITLE, SEND_CONTENT, SEND_SUCCESS, SEND_TIME, REMARK
|
|
|
+ select PR_ID,
|
|
|
+ PUSH_TYPE,
|
|
|
+ ALARM_LEVEL,
|
|
|
+ SEND_OBJ,
|
|
|
+ SEND_TITLE,
|
|
|
+ SEND_CONTENT,
|
|
|
+ SEND_SUCCESS,
|
|
|
+ SEND_TIME,
|
|
|
+ REMARK
|
|
|
from push_record
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectPushRecordList" parameterType="PushRecord" resultMap="PushRecordResult">
|
|
|
<include refid="selectPushRecordVo"/>
|
|
|
<where>
|
|
|
- <if test="pushType != null and pushType != ''">
|
|
|
- and PUSH_TYPE = #{pushType}
|
|
|
- </if>
|
|
|
- <if test="alarmLevel != null and alarmLevel != ''">
|
|
|
- and ALARM_LEVEL = #{alarmLevel}
|
|
|
- </if>
|
|
|
- <if test="sendObj != null and sendObj != ''">
|
|
|
- and SEND_OBJ like concat('%', #{sendObj}, '%')
|
|
|
- </if>
|
|
|
- <if test="sendTitle != null and sendTitle != ''">
|
|
|
- and SEND_TITLE like concat('%', #{sendTitle}, '%')
|
|
|
- </if>
|
|
|
- <if test="sendContent != null and sendContent != ''">
|
|
|
- and SEND_CONTENT like concat('%', #{sendContent}, '%')
|
|
|
- </if>
|
|
|
- <if test="sendSuccess != null and sendSuccess != ''">
|
|
|
- and SEND_SUCCESS = #{sendSuccess}
|
|
|
- </if>
|
|
|
- <if test="params.beginSendTime != null and params.beginSendTime != '' and params.endSendTime != null and params.endSendTime != ''">
|
|
|
- and SEND_TIME between #{params.beginSendTime} and #{params.endSendTime}
|
|
|
- </if>
|
|
|
- <if test="remark != null and remark != ''">
|
|
|
- and REMARK = #{remark}
|
|
|
- </if>
|
|
|
+ <if test="pushType != null and pushType != ''">
|
|
|
+ and PUSH_TYPE = #{pushType}
|
|
|
+ </if>
|
|
|
+ <if test="alarmLevel != null and alarmLevel != ''">
|
|
|
+ and ALARM_LEVEL = #{alarmLevel}
|
|
|
+ </if>
|
|
|
+ <if test="sendObj != null and sendObj != ''">
|
|
|
+ and SEND_OBJ like concat('%', #{sendObj}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sendTitle != null and sendTitle != ''">
|
|
|
+ and SEND_TITLE like concat('%', #{sendTitle}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sendContent != null and sendContent != ''">
|
|
|
+ and SEND_CONTENT like concat('%', #{sendContent}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sendSuccess != null and sendSuccess != ''">
|
|
|
+ and SEND_SUCCESS = #{sendSuccess}
|
|
|
+ </if>
|
|
|
+ <if test="params.beginSendTime != null and params.beginSendTime != '' and params.endSendTime != null and params.endSendTime != ''">
|
|
|
+ and SEND_TIME between #{params.beginSendTime} and #{params.endSendTime}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and REMARK = #{remark}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
+ order by send_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectPushRecordByPrId" parameterType="Long"
|
|
|
resultMap="PushRecordResult">
|
|
|
- <include refid="selectPushRecordVo"/>
|
|
|
- where PR_ID = #{prId}
|
|
|
+ <include refid="selectPushRecordVo"/>
|
|
|
+ where PR_ID = #{prId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertPushRecord" parameterType="PushRecord" useGeneratedKeys="true"
|
|
|
keyProperty="prId">
|
|
|
insert into push_record
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="pushType != null">PUSH_TYPE,
|
|
|
- </if>
|
|
|
- <if test="alarmLevel != null">ALARM_LEVEL,
|
|
|
- </if>
|
|
|
- <if test="sendObj != null">SEND_OBJ,
|
|
|
- </if>
|
|
|
- <if test="sendTitle != null">SEND_TITLE,
|
|
|
- </if>
|
|
|
- <if test="sendContent != null">SEND_CONTENT,
|
|
|
- </if>
|
|
|
- <if test="sendSuccess != null">SEND_SUCCESS,
|
|
|
- </if>
|
|
|
- <if test="sendTime != null">SEND_TIME,
|
|
|
- </if>
|
|
|
- <if test="remark != null">REMARK,
|
|
|
- </if>
|
|
|
+ <if test="pushType != null">PUSH_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="alarmLevel != null">ALARM_LEVEL,
|
|
|
+ </if>
|
|
|
+ <if test="sendObj != null">SEND_OBJ,
|
|
|
+ </if>
|
|
|
+ <if test="sendTitle != null">SEND_TITLE,
|
|
|
+ </if>
|
|
|
+ <if test="sendContent != null">SEND_CONTENT,
|
|
|
+ </if>
|
|
|
+ <if test="sendSuccess != null">SEND_SUCCESS,
|
|
|
+ </if>
|
|
|
+ <if test="sendTime != null">SEND_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="pushType != null">#{pushType},
|
|
|
- </if>
|
|
|
- <if test="alarmLevel != null">#{alarmLevel},
|
|
|
- </if>
|
|
|
- <if test="sendObj != null">#{sendObj},
|
|
|
- </if>
|
|
|
- <if test="sendTitle != null">#{sendTitle},
|
|
|
- </if>
|
|
|
- <if test="sendContent != null">#{sendContent},
|
|
|
- </if>
|
|
|
- <if test="sendSuccess != null">#{sendSuccess},
|
|
|
- </if>
|
|
|
- <if test="sendTime != null">#{sendTime},
|
|
|
- </if>
|
|
|
- <if test="remark != null">#{remark},
|
|
|
- </if>
|
|
|
+ <if test="pushType != null">#{pushType},
|
|
|
+ </if>
|
|
|
+ <if test="alarmLevel != null">#{alarmLevel},
|
|
|
+ </if>
|
|
|
+ <if test="sendObj != null">#{sendObj},
|
|
|
+ </if>
|
|
|
+ <if test="sendTitle != null">#{sendTitle},
|
|
|
+ </if>
|
|
|
+ <if test="sendContent != null">#{sendContent},
|
|
|
+ </if>
|
|
|
+ <if test="sendSuccess != null">#{sendSuccess},
|
|
|
+ </if>
|
|
|
+ <if test="sendTime != null">#{sendTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">#{remark},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updatePushRecord" parameterType="PushRecord">
|
|
|
update push_record
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="pushType != null">PUSH_TYPE =
|
|
|
- #{pushType},
|
|
|
- </if>
|
|
|
- <if test="alarmLevel != null">ALARM_LEVEL =
|
|
|
- #{alarmLevel},
|
|
|
- </if>
|
|
|
- <if test="sendObj != null">SEND_OBJ =
|
|
|
- #{sendObj},
|
|
|
- </if>
|
|
|
- <if test="sendTitle != null">SEND_TITLE =
|
|
|
- #{sendTitle},
|
|
|
- </if>
|
|
|
- <if test="sendContent != null">SEND_CONTENT =
|
|
|
- #{sendContent},
|
|
|
- </if>
|
|
|
- <if test="sendSuccess != null">SEND_SUCCESS =
|
|
|
- #{sendSuccess},
|
|
|
- </if>
|
|
|
- <if test="sendTime != null">SEND_TIME =
|
|
|
- #{sendTime},
|
|
|
- </if>
|
|
|
- <if test="remark != null">REMARK =
|
|
|
- #{remark},
|
|
|
- </if>
|
|
|
+ <if test="pushType != null">PUSH_TYPE =
|
|
|
+ #{pushType},
|
|
|
+ </if>
|
|
|
+ <if test="alarmLevel != null">ALARM_LEVEL =
|
|
|
+ #{alarmLevel},
|
|
|
+ </if>
|
|
|
+ <if test="sendObj != null">SEND_OBJ =
|
|
|
+ #{sendObj},
|
|
|
+ </if>
|
|
|
+ <if test="sendTitle != null">SEND_TITLE =
|
|
|
+ #{sendTitle},
|
|
|
+ </if>
|
|
|
+ <if test="sendContent != null">SEND_CONTENT =
|
|
|
+ #{sendContent},
|
|
|
+ </if>
|
|
|
+ <if test="sendSuccess != null">SEND_SUCCESS =
|
|
|
+ #{sendSuccess},
|
|
|
+ </if>
|
|
|
+ <if test="sendTime != null">SEND_TIME =
|
|
|
+ #{sendTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK =
|
|
|
+ #{remark},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
where PR_ID = #{prId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deletePushRecordByPrId" parameterType="Long">
|
|
|
delete
|
|
|
- from push_record where PR_ID = #{prId}
|
|
|
+ from push_record
|
|
|
+ where PR_ID = #{prId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deletePushRecordByPrIds" parameterType="String">
|