|
|
@@ -0,0 +1,87 @@
|
|
|
+<?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.takai.bigmodel.mapper.DialogMapper">
|
|
|
+
|
|
|
+ <resultMap type="DialogRespDTO" id="DialogResult">
|
|
|
+ <id property="id" column="id" />
|
|
|
+ <result property="dialog_name" column="dialog_name" />
|
|
|
+ <result property="dialog_id" column="dialog_id" />
|
|
|
+ <result property="did" column="did" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="create_time" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="String" id="DialogIdResult">
|
|
|
+ <id property="id" column="id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSql">
|
|
|
+ select id
|
|
|
+ from dialog
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectDialogById" parameterType="String" resultMap="DialogIdResult">
|
|
|
+ select id
|
|
|
+ from dialog
|
|
|
+ <where>
|
|
|
+ <if test="dialogId != null and dialogId != ''">
|
|
|
+ AND id = #{dialogId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDialogDetailById" parameterType="String" resultMap="DialogIdResult">
|
|
|
+ select id
|
|
|
+ from dialog_detail
|
|
|
+ <where>
|
|
|
+ <if test="detailId != null and detailId != ''">
|
|
|
+ AND id = #{detailId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDialogList" resultMap="DialogResult">
|
|
|
+ select d.id
|
|
|
+ ,d.dialog_name
|
|
|
+ ,dd.id as did
|
|
|
+ ,dd.type
|
|
|
+ ,dd.content
|
|
|
+ ,dd.dialog_id
|
|
|
+ ,dd.create_time
|
|
|
+ from dialog d
|
|
|
+ left join dialog_detail dd on d.id = dd.dialog_id
|
|
|
+ order by d.id asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertDialog" parameterType="String">
|
|
|
+ insert into dialog(
|
|
|
+ <if test="dialogId != null">id,</if>
|
|
|
+ create_time
|
|
|
+ )values(
|
|
|
+ <if test="dialogId != null">#{dialogId},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertDialogDetail" parameterType="DialogDetailReqDTO">
|
|
|
+ insert into dialog(
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="dialogId != null">dialog_id,</if>
|
|
|
+ <if test="role != null">type,</if>
|
|
|
+ <if test="content != null">content,</if>
|
|
|
+ <if test="role != null">create_by,</if>
|
|
|
+ <if test="date != null">create_time</if>
|
|
|
+ )values(
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="dialogId != null">#{dialogId},</if>
|
|
|
+ <if test="role != null">#{role},</if>
|
|
|
+ <if test="content != null">#{content},</if>
|
|
|
+ <if test="role != null">#{role},</if>
|
|
|
+ <if test="date != null">#{date}</if>
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+</mapper>
|