增加设备信息的mapper
This commit is contained in:
parent
0440cfa4fb
commit
6e4de129fe
@ -0,0 +1,14 @@
|
|||||||
|
package com.xhpc.pp.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xhpc.pp.domain.XhpcDeviceMessage;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface XhpcDeviceMessageMapper {
|
||||||
|
|
||||||
|
int insertByDomain(XhpcDeviceMessage xhpcDeviceMessage);
|
||||||
|
|
||||||
|
|
||||||
|
void deleteByLastThreeMonth(String expireDate);
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
<?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.xhpc.pp.mapper.XhpcDeviceMessageMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.xhpc.pp.domain.XhpcDeviceMessage" id="XhpcDeviceMessageResult">
|
||||||
|
<id property="deviceMessageId" column="device_message_id"/>
|
||||||
|
<result property="type" column="type"/>
|
||||||
|
<result property="serialNumber" column="serial_number"/>
|
||||||
|
<result property="content" column="content"/>
|
||||||
|
<result property="replyContent" column="reply_content"/>
|
||||||
|
<result property="status" column="status"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insertByDomain" parameterType="com.xhpc.pp.domain.XhpcDeviceMessage">
|
||||||
|
insert into xhpc_device_message(
|
||||||
|
<if test="type != null and type != 0">type,</if>
|
||||||
|
<if test="serialNumber != null and serialNumber != 0">serial_number,</if>
|
||||||
|
<if test="content != null and content != ''">content,</if>
|
||||||
|
<if test="replyContent != null and replyContent != ''">reply_content,</if>
|
||||||
|
<if test="status != null and status != ''">status,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||||
|
create_time,
|
||||||
|
update_time
|
||||||
|
)values(
|
||||||
|
<if test="type != null and type != 0">#{type},</if>
|
||||||
|
<if test="serialNumber != null and serialNumber != 0">#{serialNumber},</if>
|
||||||
|
<if test="content != null and content != ''">#{content},</if>
|
||||||
|
<if test="replyContent != null and replyContent != ''">#{replyContent},</if>
|
||||||
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||||
|
sysdate(),
|
||||||
|
sysdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="deleteByLastThreeMonth">
|
||||||
|
delete from xhpc_message
|
||||||
|
where create_time <![CDATA[ <= ]]> #{expireDate};
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
x
Reference in New Issue
Block a user