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