|
|
@@ -0,0 +1,127 @@
|
|
|
+<?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"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="UserSuperEvaluateAllSql">
|
|
|
+id, uid, aid, content, create_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="UserSuperEvaluateMap">
|
|
|
+ select
|
|
|
+ <include refid="UserSuperEvaluateAllSql"/>
|
|
|
+ from user_super_evaluate
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findUserSuperEvaluateList" resultMap="UserSuperEvaluateMap">
|
|
|
+ select
|
|
|
+ <include refid="UserSuperEvaluateAllSql"/>
|
|
|
+
|
|
|
+ from user_super_evaluate
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findUserSuperEvaluateCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from user_super_evaluate
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time)
|
|
|
+ values (#{uid}, #{aid}, #{content}, #{createTime})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_super_evaluate(uid, aid, content, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.aid}, #{entity.content}, #{entity.createTime})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+uid = values(uid),
|
|
|
+aid = values(aid),
|
|
|
+content = values(content),
|
|
|
+create_time = values(create_time)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update user_super_evaluate
|
|
|
+ <set>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null and aid != ''">
|
|
|
+ aid = #{aid},
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ content = #{content},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from user_super_evaluate where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|