MemberLogMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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.MemberLogMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.MemberLog">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="pid" jdbcType="INTEGER" property="pid" />
  7. <result column="aid" jdbcType="VARCHAR" property="aid" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  9. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id, pid, aid, `status`, remarks, create_time
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List" />
  18. from member_log
  19. where id = #{id,jdbcType=INTEGER}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  22. delete from member_log
  23. where id = #{id,jdbcType=INTEGER}
  24. </delete>
  25. <insert id="insert" parameterType="com.goafanti.common.model.MemberLog">
  26. insert into member_log (id, pid, aid,
  27. `status`, remarks, create_time
  28. )
  29. values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR},
  30. #{status,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  31. )
  32. </insert>
  33. <insert id="insertSelective" parameterType="com.goafanti.common.model.MemberLog">
  34. insert into member_log
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="id != null">
  37. id,
  38. </if>
  39. <if test="pid != null">
  40. pid,
  41. </if>
  42. <if test="aid != null">
  43. aid,
  44. </if>
  45. <if test="status != null">
  46. `status`,
  47. </if>
  48. <if test="remarks != null">
  49. remarks,
  50. </if>
  51. <if test="createTime != null">
  52. create_time,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides=",">
  56. <if test="id != null">
  57. #{id,jdbcType=INTEGER},
  58. </if>
  59. <if test="pid != null">
  60. #{pid,jdbcType=INTEGER},
  61. </if>
  62. <if test="aid != null">
  63. #{aid,jdbcType=VARCHAR},
  64. </if>
  65. <if test="status != null">
  66. #{status,jdbcType=INTEGER},
  67. </if>
  68. <if test="remarks != null">
  69. #{remarks,jdbcType=VARCHAR},
  70. </if>
  71. <if test="createTime != null">
  72. #{createTime,jdbcType=TIMESTAMP},
  73. </if>
  74. </trim>
  75. </insert>
  76. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.MemberLog">
  77. update member_log
  78. <set>
  79. <if test="pid != null">
  80. pid = #{pid,jdbcType=INTEGER},
  81. </if>
  82. <if test="aid != null">
  83. aid = #{aid,jdbcType=VARCHAR},
  84. </if>
  85. <if test="status != null">
  86. `status` = #{status,jdbcType=INTEGER},
  87. </if>
  88. <if test="remarks != null">
  89. remarks = #{remarks,jdbcType=VARCHAR},
  90. </if>
  91. <if test="createTime != null">
  92. create_time = #{createTime,jdbcType=TIMESTAMP},
  93. </if>
  94. </set>
  95. where id = #{id,jdbcType=INTEGER}
  96. </update>
  97. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.MemberLog">
  98. update member_log
  99. set pid = #{pid,jdbcType=INTEGER},
  100. aid = #{aid,jdbcType=VARCHAR},
  101. `status` = #{status,jdbcType=INTEGER},
  102. remarks = #{remarks,jdbcType=VARCHAR},
  103. create_time = #{createTime,jdbcType=TIMESTAMP}
  104. where id = #{id,jdbcType=INTEGER}
  105. </update>
  106. <select id="memberLog" resultType="com.goafanti.order.bo.MemberLogBo">
  107. select a.id, a.pid, a.aid, a.`status`, a.remarks, a.create_time createTime,
  108. b.name aname,date_format(a.create_time,'%Y-%m-%d %H:%i:%s' )createTimes
  109. from member_log a left join admin b on a.aid =b.id
  110. where pid= #{id}
  111. </select>
  112. </mapper>