|
|
@@ -1,85 +1,141 @@
|
|
|
<?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.UserDataLogMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserDataLog">
|
|
|
- <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
- <result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- id, `uid`, create_time, remarks
|
|
|
- </sql>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from user_data_log
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
-
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
- delete from user_data_log
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserDataLog" useGeneratedKeys="true">
|
|
|
- insert into user_data_log (`uid`, create_time, remarks
|
|
|
- )
|
|
|
- values (#{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserDataLog" useGeneratedKeys="true">
|
|
|
- insert into user_data_log
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="uid != null">
|
|
|
- `uid`,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="remarks != null">
|
|
|
- remarks,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="uid != null">
|
|
|
- #{uid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="remarks != null">
|
|
|
- #{remarks,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserDataLog">
|
|
|
- update user_data_log
|
|
|
- <set>
|
|
|
- <if test="uid != null">
|
|
|
- `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="remarks != null">
|
|
|
- remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserDataLog">
|
|
|
- update user_data_log
|
|
|
- set `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- remarks = #{remarks,jdbcType=VARCHAR}
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
-
|
|
|
- <select id="userDateLogList" resultType="com.goafanti.customer.bo.OutUserDateLogList">
|
|
|
- select id,uid,remarks ,create_time ,
|
|
|
- date_format(create_time ,'%Y-%m-%d %H:%i:%s')createTimes
|
|
|
- from user_data_log
|
|
|
- where uid= #{uid}
|
|
|
- order by create_time desc
|
|
|
- </select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <resultMap type="com.goafanti.common.model.UserDataLog" id="UserDataLogMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="uid" column="uid" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="UserDataLogAllSql">
|
|
|
+ id, uid, create_time, remarks, type
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="UserDataLogMap">
|
|
|
+ select
|
|
|
+ <include refid="UserDataLogAllSql"/>
|
|
|
+ from user_data_log
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="findUserDataLogList" resultMap="UserDataLogMap">
|
|
|
+ select
|
|
|
+ <include refid="UserDataLogAllSql"/>
|
|
|
+
|
|
|
+ from user_data_log
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ and remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="findUserDataLogCount" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
+ from user_data_log
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ and uid = #{uid}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ and remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_data_log(uid, create_time, remarks, type)
|
|
|
+ values (#{uid}, #{createTime}, #{remarks}, #{type})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch">
|
|
|
+ insert into user_data_log(uid, create_time, remarks, type)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.createTime}, #{entity.remarks}, #{entity.type})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into user_data_log(uid, create_time, remarks, type)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.uid}, #{entity.createTime}, #{entity.remarks}, #{entity.type})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ uid = values(uid),
|
|
|
+ create_time = values(create_time),
|
|
|
+ remarks = values(remarks),
|
|
|
+ type = values(type)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update user_data_log
|
|
|
+ <set>
|
|
|
+ <if test="uid != null and uid != ''">
|
|
|
+ uid = #{uid},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ remarks = #{remarks},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from user_data_log
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="userDateLogList" resultType="com.goafanti.customer.bo.OutUserDateLogList">
|
|
|
+ select id,uid,remarks ,create_time ,
|
|
|
+ date_format(create_time ,'%Y-%m-%d %H:%i:%s')createTimes
|
|
|
+ from user_data_log
|
|
|
+ where uid= #{uid}
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|