UserDataLogMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.goafanti.common.dao.UserDataLogMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserDataLog">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="uid" jdbcType="VARCHAR" property="uid" />
  7. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  8. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  9. </resultMap>
  10. <sql id="Base_Column_List">
  11. id, `uid`, create_time, remarks
  12. </sql>
  13. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  14. select
  15. <include refid="Base_Column_List" />
  16. from user_data_log
  17. where id = #{id,jdbcType=INTEGER}
  18. </select>
  19. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  20. delete from user_data_log
  21. where id = #{id,jdbcType=INTEGER}
  22. </delete>
  23. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserDataLog" useGeneratedKeys="true">
  24. insert into user_data_log (`uid`, create_time, remarks
  25. )
  26. values (#{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}
  27. )
  28. </insert>
  29. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.UserDataLog" useGeneratedKeys="true">
  30. insert into user_data_log
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="uid != null">
  33. `uid`,
  34. </if>
  35. <if test="createTime != null">
  36. create_time,
  37. </if>
  38. <if test="remarks != null">
  39. remarks,
  40. </if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides=",">
  43. <if test="uid != null">
  44. #{uid,jdbcType=VARCHAR},
  45. </if>
  46. <if test="createTime != null">
  47. #{createTime,jdbcType=TIMESTAMP},
  48. </if>
  49. <if test="remarks != null">
  50. #{remarks,jdbcType=VARCHAR},
  51. </if>
  52. </trim>
  53. </insert>
  54. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserDataLog">
  55. update user_data_log
  56. <set>
  57. <if test="uid != null">
  58. `uid` = #{uid,jdbcType=VARCHAR},
  59. </if>
  60. <if test="createTime != null">
  61. create_time = #{createTime,jdbcType=TIMESTAMP},
  62. </if>
  63. <if test="remarks != null">
  64. remarks = #{remarks,jdbcType=VARCHAR},
  65. </if>
  66. </set>
  67. where id = #{id,jdbcType=INTEGER}
  68. </update>
  69. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserDataLog">
  70. update user_data_log
  71. set `uid` = #{uid,jdbcType=VARCHAR},
  72. create_time = #{createTime,jdbcType=TIMESTAMP},
  73. remarks = #{remarks,jdbcType=VARCHAR}
  74. where id = #{id,jdbcType=INTEGER}
  75. </update>
  76. <select id="userDateLogList" resultType="com.goafanti.customer.bo.OutUserDateLogList">
  77. select id,uid,remarks ,create_time ,
  78. date_format(create_time ,'%Y-%m-%d %H:%i:%s')createTimes
  79. from user_data_log
  80. where uid= #{uid}
  81. order by create_time desc
  82. </select>
  83. </mapper>