|
|
@@ -1,40 +1,53 @@
|
|
|
<?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.goafanti.common.dao.UserSuperEvaluateMapper">
|
|
|
-
|
|
|
<resultMap type="com.goafanti.common.model.UserSuperEvaluate" id="UserSuperEvaluateMap">
|
|
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
<result property="uid" column="uid" jdbcType="VARCHAR"/>
|
|
|
<result property="aid" column="aid" jdbcType="VARCHAR"/>
|
|
|
<result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
+
|
|
|
<sql id="UserSuperEvaluateAllSql">
|
|
|
-id, uid, aid, content, create_time
|
|
|
+ id, uid, aid, content, create_time, type
|
|
|
</sql>
|
|
|
|
|
|
<!--查询单个-->
|
|
|
<select id="queryById" resultMap="UserSuperEvaluateMap">
|
|
|
select
|
|
|
- <include refid="UserSuperEvaluateAllSql"/>
|
|
|
+ <include refid="UserSuperEvaluateAllSql"/>
|
|
|
from user_super_evaluate
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<!--查询指定行数据-->
|
|
|
- <select id="findUserSuperEvaluateList" resultType="com.goafanti.customer.bo.OutUserSuperEvaluate">
|
|
|
+ <select id="findUserSuperEvaluateList" resultMap="UserSuperEvaluateMap">
|
|
|
select
|
|
|
- a.id, a.uid, a.aid, a.content, a.create_time as createTime,b.name adminName
|
|
|
- from user_super_evaluate a left join admin b on a.aid=b.id
|
|
|
- where 1=1
|
|
|
+ <include refid="UserSuperEvaluateAllSql"/>
|
|
|
+
|
|
|
+ from user_super_evaluate
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
<if test="uid != null and uid != ''">
|
|
|
- and a.uid = #{uid}
|
|
|
+ and uid = #{uid}
|
|
|
</if>
|
|
|
<if test="aid != null and aid != ''">
|
|
|
- and a.aid = #{aid}
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
</if>
|
|
|
- order by a.create_time desc
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
@@ -44,40 +57,54 @@ id, uid, aid, content, create_time
|
|
|
<select id="findUserSuperEvaluateCount" resultType="java.lang.Integer">
|
|
|
select count(1)
|
|
|
from user_super_evaluate
|
|
|
- where 1=1
|
|
|
- <if test="uid != null and uid != ''">
|
|
|
- and uid = #{uid}
|
|
|
- </if>
|
|
|
- <if test="aid != null and aid != ''">
|
|
|
- and aid = #{aid}
|
|
|
- </if>
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ and aid = #{aid}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<!--新增所有列-->
|
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into user_super_evaluate(uid, aid, content)
|
|
|
- values (#{uid}, #{aid}, #{content})
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time, type)
|
|
|
+ values (#{uid}, #{aid}, #{content}, #{createTime}, #{type})
|
|
|
</insert>
|
|
|
|
|
|
- <insert id="insertBatch" >
|
|
|
- insert into user_super_evaluate(uid, aid, content, create_time)
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time, type)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime})
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime}, #{entity.type})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
- insert into user_super_evaluate(uid, aid, content, create_time)
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time, type)
|
|
|
values
|
|
|
<foreach collection="entities" item="entity" separator=",">
|
|
|
- (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime})
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime}, #{entity.type})
|
|
|
</foreach>
|
|
|
on duplicate key update
|
|
|
-uid = values(uid),
|
|
|
-aid = values(aid),
|
|
|
-content = values(content),
|
|
|
-create_time = values(create_time)
|
|
|
+ uid = values(uid),
|
|
|
+ aid = values(aid),
|
|
|
+ content = values(content),
|
|
|
+ create_time = values(create_time),
|
|
|
+ type = values(type)
|
|
|
</insert>
|
|
|
|
|
|
<!--通过主键修改数据-->
|
|
|
@@ -96,14 +123,18 @@ create_time = values(create_time)
|
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<!--通过主键删除-->
|
|
|
<delete id="deleteById">
|
|
|
- delete from user_super_evaluate where id = #{id}
|
|
|
+ delete
|
|
|
+ from user_super_evaluate
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
-
|
|
|
</mapper>
|
|
|
|