HomeChannelGroupMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.marketing.HomeChannelGroupMapper" >
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannelGroup" >
  5. <id column="group_id" property="groupId" jdbcType="BIGINT" />
  6. <result column="group_name" property="groupName" jdbcType="VARCHAR" />
  7. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  8. </resultMap>
  9. <sql id="Base_Column_List" >
  10. group_id, group_name, create_time
  11. </sql>
  12. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  13. select
  14. <include refid="Base_Column_List" />
  15. from home_channel_group
  16. where group_id = #{groupId,jdbcType=BIGINT}
  17. </select>
  18. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  19. delete from home_channel_group
  20. where group_id = #{groupId,jdbcType=BIGINT}
  21. </delete>
  22. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannelGroup" >
  23. <selectKey resultType="java.lang.Long" keyProperty="groupId" order="AFTER" >
  24. SELECT LAST_INSERT_ID()
  25. </selectKey>
  26. insert into home_channel_group (group_name, create_time)
  27. values (#{groupName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  28. </insert>
  29. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannelGroup" >
  30. <selectKey resultType="java.lang.Long" keyProperty="groupId" order="AFTER" >
  31. SELECT LAST_INSERT_ID()
  32. </selectKey>
  33. insert into home_channel_group
  34. <trim prefix="(" suffix=")" suffixOverrides="," >
  35. <if test="groupName != null" >
  36. group_name,
  37. </if>
  38. <if test="createTime != null" >
  39. create_time,
  40. </if>
  41. </trim>
  42. <trim prefix="values (" suffix=")" suffixOverrides="," >
  43. <if test="groupName != null" >
  44. #{groupName,jdbcType=VARCHAR},
  45. </if>
  46. <if test="createTime != null" >
  47. #{createTime,jdbcType=TIMESTAMP},
  48. </if>
  49. </trim>
  50. </insert>
  51. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannelGroup" >
  52. update home_channel_group
  53. <set >
  54. <if test="groupName != null" >
  55. group_name = #{groupName,jdbcType=VARCHAR},
  56. </if>
  57. <if test="createTime != null" >
  58. create_time = #{createTime,jdbcType=TIMESTAMP},
  59. </if>
  60. </set>
  61. where group_id = #{groupId,jdbcType=BIGINT}
  62. </update>
  63. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannelGroup" >
  64. update home_channel_group
  65. set group_name = #{groupName,jdbcType=VARCHAR},
  66. create_time = #{createTime,jdbcType=TIMESTAMP}
  67. where group_id = #{groupId,jdbcType=BIGINT}
  68. </update>
  69. <select id="selectHomeChannelGroupByList" resultMap="BaseResultMap">
  70. SELECT <include refid="Base_Column_List" />
  71. FROM home_channel_group
  72. </select>
  73. </mapper>