ActivityUserMapperAdjustLogMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. <!--
  4. 这个文件是自动生成的。
  5. 不要修改此文件。所有改动将在下次重新自动生成时丢失。
  6. -->
  7. <mapper namespace="com.ym.mec.biz.dal.dao.ActivityUserMapperAdjustLogDao">
  8. <resultMap type="com.ym.mec.biz.dal.entity.ActivityUserMapperAdjustLog" id="ActivityUserMapperAdjustLog">
  9. <result column="id_" property="id" />
  10. <result column="operator_id_" property="operatorId" />
  11. <result column="operator_name_" property="operatorName" />
  12. <result column="activity_id_" property="activityId" />
  13. <result column="course_num_" property="courseNum" />
  14. <result column="give_course_num_" property="giveCourseNum" />
  15. <result column="memo_" property="memo" />
  16. <result column="user_id_" property="userId" />
  17. <result column="type_" property="type" />
  18. <result column="activity_user_mapper_id_" property="activityUserMapperId" />
  19. <result column="create_time_" property="createTime" />
  20. <result column="update_time_" property="updateTime" />
  21. </resultMap>
  22. <!-- 根据主键查询一条记录 -->
  23. <select id="get" resultMap="ActivityUserMapperAdjustLog" >
  24. SELECT * FROM activity_user_mapper_adjust_log WHERE id_ = #{id}
  25. </select>
  26. <!-- 全查询 -->
  27. <select id="findAll" resultMap="ActivityUserMapperAdjustLog">
  28. SELECT * FROM activity_user_mapper_adjust_log ORDER BY id_
  29. </select>
  30. <!-- 向数据库增加一条记录 -->
  31. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapperAdjustLog" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  32. INSERT INTO activity_user_mapper_adjust_log (operator_id_,operator_name_,activity_id_,
  33. course_num_,give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_)
  34. VALUES(#{operatorId},#{operatorName},#{activityId},#{courseNum},#{giveCourseNum},#{memo},#{userId},NOW(),NOW(),#{type},#{activityUserMapperId})
  35. </insert>
  36. <insert id="batchInsert">
  37. INSERT INTO activity_user_mapper_adjust_log (operator_id_,operator_name_,activity_id_,course_num_,
  38. give_course_num_,memo_,user_id_,create_time_,update_time_,type_,activity_user_mapper_id_)
  39. VALUES
  40. <foreach collection="logs" separator="," item="bean">
  41. (#{bean.operatorId},#{bean.operatorName},#{bean.activityId},#{bean.courseNum},#{bean.giveCourseNum},#{bean.memo},#{bean.userId},NOW(),NOW(),#{bean.type},#{bean.activityUserMapperId})
  42. </foreach>
  43. </insert>
  44. <!-- 根据主键查询一条记录 -->
  45. <update id="update" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapperAdjustLog">
  46. UPDATE activity_user_mapper_adjust_log <set>
  47. <if test="operatorId != null">
  48. operator_id_ = #{operatorId},
  49. </if>
  50. <if test="userId != null">
  51. user_id_ = #{userId},
  52. </if>
  53. <if test="courseNum != null">
  54. course_num_ = #{courseNum},
  55. </if>
  56. <if test="memo != null">
  57. memo_ = #{memo},
  58. </if>
  59. <if test="operatorName != null">
  60. operator_name_ = #{operatorName},
  61. </if>
  62. <if test="giveCourseNum != null">
  63. give_course_num_ = #{giveCourseNum},
  64. </if>
  65. <if test="activityId != null">
  66. activity_id_ = #{activityId},
  67. </if>
  68. update_time_ = NOW()
  69. </set> WHERE id_ = #{id}
  70. </update>
  71. <!-- 根据主键删除一条记录 -->
  72. <delete id="delete" >
  73. DELETE FROM activity_user_mapper_adjust_log WHERE id_ = #{id}
  74. </delete>
  75. <!-- 分页查询 -->
  76. <select id="queryPage" resultMap="ActivityUserMapperAdjustLog" parameterType="map">
  77. SELECT * FROM activity_user_mapper_adjust_log
  78. <where>
  79. <if test="userId != null">
  80. AND user_id_ = #{userId}
  81. </if>
  82. <if test="activityId != null">
  83. AND activity_id_ = #{activityId}
  84. </if>
  85. </where>
  86. ORDER BY id_
  87. <include refid="global.limit"/>
  88. </select>
  89. <!-- 查询当前表的总记录数 -->
  90. <select id="queryCount" resultType="int">
  91. SELECT COUNT(*) FROM activity_user_mapper_adjust_log
  92. <where>
  93. <if test="userId != null">
  94. AND user_id_ = #{userId}
  95. </if>
  96. <if test="activityId != null">
  97. AND activity_id_ = #{activityId}
  98. </if>
  99. </where>
  100. </select>
  101. </mapper>