ReviewConfigMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.juxiao.xchat.module.xbd.mapper.operation.ReviewConfigMapper" >
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.operation.ReviewConfig" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="tag_name" property="tagName" jdbcType="VARCHAR" />
  7. <result column="recharge_amount" property="rechargeAmount" jdbcType="INTEGER" />
  8. <result column="status" property="status" jdbcType="INTEGER" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="system_id" property="system" jdbcType="INTEGER" />
  11. <result column="versions" property="versions" jdbcType="VARCHAR" />
  12. <result column="channel" property="channel" jdbcType="VARCHAR" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. id, tag_name, recharge_amount, status, create_time, system_id, versions, channel
  16. </sql>
  17. <select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  18. select
  19. <include refid="Base_Column_List" />
  20. from review_config
  21. where id = #{id,jdbcType=INTEGER}
  22. </select>
  23. <select id="getReviewConfigList" resultMap="BaseResultMap">
  24. select rc.id, rc.tag_name , rc.recharge_amount , rc.status, rc.create_time , rc.system_id, rc.versions, rc.channel
  25. from review_config rc
  26. where 1 = 1
  27. <if test="tagName != null and tagName !=''">
  28. and rc.tag_name LIKE CONCAT('%',#{tagName},'%')
  29. </if>
  30. <if test="channel != null and channel !=''">
  31. and rc.channel = #{channel}
  32. </if>
  33. <if test="system != null and system !=''">
  34. and rc.system_id = #{system}
  35. </if>
  36. order by rc.create_time desc
  37. </select>
  38. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.operation.ReviewConfig" useGeneratedKeys="true" keyProperty="id" >
  39. insert into review_config (tag_name, recharge_amount, status,
  40. create_time, system_id, versions,
  41. channel)
  42. values (#{tagName,jdbcType=VARCHAR}, #{rechargeAmount,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
  43. #{createTime,jdbcType=TIMESTAMP}, #{system,jdbcType=INTEGER}, #{versions,jdbcType=VARCHAR},
  44. #{channel,jdbcType=VARCHAR})
  45. </insert>
  46. <update id="updateById" parameterType="com.juxiao.xchat.module.xbd.domain.operation.ReviewConfig">
  47. update review_config
  48. set
  49. tag_name = #{tagName,jdbcType=VARCHAR},
  50. recharge_amount = #{rechargeAmount,jdbcType=INTEGER},
  51. status = #{status,jdbcType=INTEGER},
  52. create_time = #{createTime,jdbcType=TIMESTAMP},
  53. system_id = #{system,jdbcType=INTEGER},
  54. versions = #{versions,jdbcType=VARCHAR},
  55. channel = #{channel,jdbcType=VARCHAR}
  56. where id = #{id,jdbcType=INTEGER}
  57. </update>
  58. <delete id="deleteById" parameterType="java.lang.Integer" >
  59. delete from review_config
  60. where id = #{id,jdbcType=INTEGER}
  61. </delete>
  62. </mapper>