2024-12-20 13:43:01 +08:00
|
|
|
<?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.bonus.material.basic.mapper.BmMessageMapper">
|
|
|
|
|
<resultMap type="com.bonus.material.basic.domain.BmMessage" id="BmMessageResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="uuid" column="uuid" />
|
|
|
|
|
<result property="fromUser" column="from_user" />
|
|
|
|
|
<result property="toUser" column="to_user" />
|
|
|
|
|
<result property="fromCompany" column="from_company" />
|
|
|
|
|
<result property="toCompany" column="to_company" />
|
|
|
|
|
<result property="messageType" column="message_type" />
|
2024-12-20 13:56:34 +08:00
|
|
|
<result property="messageTopic" column="message_topic" />
|
|
|
|
|
<result property="messageContent" column="message_content" />
|
2024-12-20 13:43:01 +08:00
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectBmMessageVo">
|
2024-12-20 13:56:34 +08:00
|
|
|
select id, uuid, from_user, to_user, from_company, to_company, message_content, message_topic, message_type, create_time, update_time from bm_message
|
2024-12-20 13:43:01 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBmMessageList" parameterType="com.bonus.material.basic.domain.BmMessage" resultMap="BmMessageResult">
|
|
|
|
|
<include refid="selectBmMessageVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="uuid != null and uuid != ''"> and uuid = #{uuid}</if>
|
2024-12-20 15:21:10 +08:00
|
|
|
<if test="fromUser != null and toUser != null"> and (from_user = #{fromUser} or to_user = #{toUser})</if>
|
|
|
|
|
<if test="fromCompany != null and toCompany != null"> and (from_company = #{fromCompany} or to_company = #{toCompany})</if>
|
2024-12-20 13:43:01 +08:00
|
|
|
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
|
2024-12-20 13:56:34 +08:00
|
|
|
<if test="messageTopic != null and messageTopic != ''"> and message_topic = #{messageTopic}</if>
|
2024-12-20 13:43:01 +08:00
|
|
|
<if test="messageType != null and messageType != ''"> and message_type = #{messageType}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBmMessageById" parameterType="Long" resultMap="BmMessageResult">
|
|
|
|
|
<include refid="selectBmMessageVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertBmMessage" parameterType="com.bonus.material.basic.domain.BmMessage" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into bm_message
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="uuid != null">uuid,</if>
|
|
|
|
|
<if test="fromUser != null">from_user,</if>
|
|
|
|
|
<if test="toUser != null">to_user,</if>
|
|
|
|
|
<if test="fromCompany != null">from_company,</if>
|
|
|
|
|
<if test="toCompany != null">to_company,</if>
|
|
|
|
|
<if test="messageContent != null">message_content,</if>
|
2024-12-20 13:56:34 +08:00
|
|
|
<if test="messageTopic != null">message_topic,</if>
|
2024-12-20 13:43:01 +08:00
|
|
|
<if test="messageType != null">message_type,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="uuid != null">#{uuid},</if>
|
|
|
|
|
<if test="fromUser != null">#{fromUser},</if>
|
|
|
|
|
<if test="toUser != null">#{toUser},</if>
|
|
|
|
|
<if test="fromCompany != null">#{fromCompany},</if>
|
|
|
|
|
<if test="toCompany != null">#{toCompany},</if>
|
|
|
|
|
<if test="messageContent != null">#{messageContent},</if>
|
2024-12-20 13:56:34 +08:00
|
|
|
<if test="messageTopic != null">#{messageTopic},</if>
|
2024-12-20 13:43:01 +08:00
|
|
|
<if test="messageType != null">#{messageType},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateBmMessage" parameterType="com.bonus.material.basic.domain.BmMessage">
|
|
|
|
|
update bm_message
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="uuid != null">uuid = #{uuid},</if>
|
|
|
|
|
<if test="fromUser != null">from_user = #{fromUser},</if>
|
|
|
|
|
<if test="toUser != null">to_user = #{toUser},</if>
|
|
|
|
|
<if test="fromCompany != null">from_company = #{fromCompany},</if>
|
|
|
|
|
<if test="toCompany != null">to_company = #{toCompany},</if>
|
|
|
|
|
<if test="messageContent != null">message_content = #{messageContent},</if>
|
2024-12-20 13:56:34 +08:00
|
|
|
<if test="messageTopic != null">message_topic = #{messageTopic},</if>
|
2024-12-20 13:43:01 +08:00
|
|
|
<if test="messageType != null">message_type = #{messageType},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBmMessageById" parameterType="Long">
|
|
|
|
|
delete from bm_message where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBmMessageByIds" parameterType="String">
|
|
|
|
|
delete from bm_message where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|