ErnieBotCommonDao.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.ErnieBotCommonDao">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.ErnieBotCommon">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="content" jdbcType="VARCHAR" property="content" />
  7. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  8. </resultMap>
  9. <sql id="Base_Column_List">
  10. id, content, create_time
  11. </sql>
  12. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  13. select
  14. <include refid="Base_Column_List" />
  15. from ernie_bot_common
  16. where id = #{id,jdbcType=INTEGER}
  17. </select>
  18. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  19. delete from ernie_bot_common
  20. where id = #{id,jdbcType=INTEGER}
  21. </delete>
  22. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ErnieBotCommon" useGeneratedKeys="true">
  23. insert into ernie_bot_common (content, create_time)
  24. values (#{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  25. </insert>
  26. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.ErnieBotCommon" useGeneratedKeys="true">
  27. insert into ernie_bot_common
  28. <trim prefix="(" suffix=")" suffixOverrides=",">
  29. <if test="content != null">
  30. content,
  31. </if>
  32. <if test="createTime != null">
  33. create_time,
  34. </if>
  35. </trim>
  36. <trim prefix="values (" suffix=")" suffixOverrides=",">
  37. <if test="content != null">
  38. #{content,jdbcType=VARCHAR},
  39. </if>
  40. <if test="createTime != null">
  41. #{createTime,jdbcType=TIMESTAMP},
  42. </if>
  43. </trim>
  44. </insert>
  45. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ErnieBotCommon">
  46. update ernie_bot_common
  47. <set>
  48. <if test="content != null">
  49. content = #{content,jdbcType=VARCHAR},
  50. </if>
  51. <if test="createTime != null">
  52. create_time = #{createTime,jdbcType=TIMESTAMP},
  53. </if>
  54. </set>
  55. where id = #{id,jdbcType=INTEGER}
  56. </update>
  57. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ErnieBotCommon">
  58. update ernie_bot_common
  59. set content = #{content,jdbcType=VARCHAR},
  60. create_time = #{createTime,jdbcType=TIMESTAMP}
  61. where id = #{id,jdbcType=INTEGER}
  62. </update>
  63. <select id="selectAll" resultMap="BaseResultMap">
  64. select
  65. <include refid="Base_Column_List" />
  66. from ernie_bot_common
  67. limit #{count}
  68. </select>
  69. </mapper>