ProductCustomClassificationMapper.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.product.dao.ProductCustomClassificationDao">
  4. <sql id="productCustomClassificationColumns">
  5. a.id AS "id",
  6. a.productID AS "productID",
  7. a.bigTypeID AS "bigTypeID",
  8. a.smallTypeID AS "smallTypeID",
  9. a.tinyTypeID AS "tinyTypeID",
  10. a.createDate AS "createDate",
  11. a.updateDate AS "updateDate"
  12. </sql>
  13. <sql id="productCustomClassificationJoins">
  14. </sql>
  15. <select id="get" resultType="ProductCustomClassification">
  16. SELECT
  17. <include refid="productCustomClassificationColumns"/>
  18. FROM product_custom_classification a
  19. <include refid="productCustomClassificationJoins"/>
  20. WHERE a.id = #{id}
  21. </select>
  22. <select id="findList" resultType="ProductCustomClassification">
  23. SELECT
  24. <include refid="productCustomClassificationColumns"/>
  25. FROM product_custom_classification a
  26. <include refid="productCustomClassificationJoins"/>
  27. <where>
  28. </where>
  29. <choose>
  30. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  31. ORDER BY ${page.orderBy}
  32. </when>
  33. <otherwise>
  34. </otherwise>
  35. </choose>
  36. </select>
  37. <select id="findAllList" resultType="ProductCustomClassification">
  38. SELECT
  39. <include refid="productCustomClassificationColumns"/>
  40. FROM product_custom_classification a
  41. <include refid="productCustomClassificationJoins"/>
  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="ProductCustomClassification" keyProperty="id" useGeneratedKeys="true">
  53. INSERT INTO product_custom_classification(
  54. id,
  55. productID,
  56. bigTypeID,
  57. smallTypeID,
  58. tinyTypeID,
  59. createDate,
  60. updateDate
  61. ) VALUES (
  62. #{id},
  63. #{productID},
  64. #{bigTypeID},
  65. #{smallTypeID},
  66. #{tinyTypeID},
  67. #{createDate},
  68. #{updateDate}
  69. )
  70. </insert>
  71. <update id="update">
  72. UPDATE product_custom_classification SET
  73. productID = #{productID},
  74. bigTypeID = #{bigTypeID},
  75. smallTypeID = #{smallTypeID},
  76. tinyTypeID = #{tinyTypeID},
  77. createDate = #{createDate},
  78. updateDate = #{updateDate}
  79. WHERE id = #{id}
  80. </update>
  81. <delete id="delete">
  82. DELETE FROM product_custom_classification
  83. WHERE id = #{id}
  84. </delete>
  85. <select id="findCustomClassification" resultType="com.caimei.modules.product.entity.ProductCustomClassification">
  86. select <include refid="productCustomClassificationColumns"/>
  87. from product_custom_classification a where a.productID = #{productID}
  88. </select>
  89. </mapper>