HotWordsLabelMapper.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.HotWordsLabelDao">
  8. <resultMap type="com.ym.mec.biz.dal.entity.HotWordsLabel" id="HotWordsLabel">
  9. <result column="id_" property="id" />
  10. <result column="name_" property="name" />
  11. <result column="create_time_" property="createTime" />
  12. <result column="update_time_" property="updateTime" />
  13. <result column="del_flag_" property="delFlag" />
  14. </resultMap>
  15. <!-- 根据主键查询一条记录 -->
  16. <select id="get" resultMap="HotWordsLabel" >
  17. SELECT * FROM hot_words_label WHERE id_ = #{id}
  18. </select>
  19. <!-- 全查询 -->
  20. <select id="findAll" resultMap="HotWordsLabel">
  21. SELECT * FROM hot_words_label ORDER BY id_
  22. </select>
  23. <!-- 向数据库增加一条记录 -->
  24. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.HotWordsLabel" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  25. <!--
  26. <selectKey resultClass="int" keyProperty="id" >
  27. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  28. </selectKey>
  29. -->
  30. INSERT INTO hot_words_label (id_,name_,create_time_,update_time_,del_flag_) VALUES(#{id},#{name},#{createTime},NOW(),#{delFlag})
  31. </insert>
  32. <!-- 根据主键查询一条记录 -->
  33. <update id="update" parameterType="com.ym.mec.biz.dal.entity.HotWordsLabel">
  34. UPDATE hot_words_label <set>
  35. <if test="delFlag != null">
  36. del_flag_ = #{delFlag},
  37. </if>
  38. <if test="id != null">
  39. id_ = #{id},
  40. </if>
  41. <if test="updateTime != null">
  42. update_time_ = NOW(),
  43. </if>
  44. <if test="name != null">
  45. name_ = #{name},
  46. </if>
  47. <if test="createTime != null">
  48. create_time_ = #{createTime},
  49. </if>
  50. </set> WHERE id_ = #{id}
  51. </update>
  52. <!-- 根据主键删除一条记录 -->
  53. <delete id="delete" >
  54. DELETE FROM hot_words_label WHERE id_ = #{id}
  55. </delete>
  56. <!-- 分页查询 -->
  57. <select id="queryPage" resultMap="HotWordsLabel" parameterType="map">
  58. SELECT * FROM hot_words_label ORDER BY id_ <include refid="global.limit"/>
  59. </select>
  60. <!-- 查询当前表的总记录数 -->
  61. <select id="queryCount" resultType="int">
  62. SELECT COUNT(*) FROM hot_words_label
  63. </select>
  64. </mapper>