CmHeheFloorMapper.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.caimei.modules.hehe.dao.CmHeheFloorDao">
  4. <sql id="cmHeheFloorColumns">
  5. a.id AS "id",
  6. a.title AS "title",
  7. a.description AS "description",
  8. a.sort AS "sort",
  9. a.status AS "status",
  10. a.createTime AS "createTime"
  11. </sql>
  12. <sql id="cmHeheFloorJoins">
  13. </sql>
  14. <select id="get" resultType="cmHeheFloor">
  15. SELECT
  16. <include refid="cmHeheFloorColumns"/>
  17. FROM cm_hehe_floor a
  18. <include refid="cmHeheFloorJoins"/>
  19. WHERE a.id = #{id}
  20. </select>
  21. <select id="findList" resultType="cmHeheFloor">
  22. SELECT
  23. <include refid="cmHeheFloorColumns"/>
  24. FROM cm_hehe_floor a
  25. <include refid="cmHeheFloorJoins"/>
  26. <where>
  27. </where>
  28. <choose>
  29. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  30. ORDER BY ${page.orderBy}
  31. </when>
  32. <otherwise>
  33. order by a.sort asc,a.createTime desc
  34. </otherwise>
  35. </choose>
  36. </select>
  37. <select id="findAllList" resultType="cmHeheFloor">
  38. SELECT
  39. <include refid="cmHeheFloorColumns"/>
  40. FROM cm_hehe_floor a
  41. <include refid="cmHeheFloorJoins"/>
  42. <where>
  43. </where>
  44. <choose>
  45. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  46. ORDER BY ${page.orderBy}
  47. </when>
  48. <otherwise>
  49. </otherwise>
  50. </choose>
  51. </select>
  52. <insert id="insert" parameterType="cmHeheFloor" keyProperty="id" useGeneratedKeys="true">
  53. INSERT INTO cm_hehe_floor(
  54. title,
  55. description,
  56. sort,
  57. status,
  58. createTime
  59. ) VALUES (
  60. #{title},
  61. #{description},
  62. #{sort},
  63. #{status},
  64. #{createTime}
  65. )
  66. </insert>
  67. <update id="update">
  68. UPDATE cm_hehe_floor SET
  69. title = #{title},
  70. description = #{description},
  71. sort = #{sort},
  72. status = #{status}
  73. WHERE id = #{id}
  74. </update>
  75. <update id="updateStatusByFloorId">
  76. update cm_hehe_floor set status = #{status} where id = #{floorId}
  77. </update>
  78. <update id="saveSort">
  79. update cm_hehe_floor set sort = #{sort} where id = #{floorId}
  80. </update>
  81. <delete id="delete">
  82. DELETE FROM cm_hehe_floor
  83. WHERE id = #{id}
  84. </delete>
  85. </mapper>