ChildrenDayDegreeInfoDao.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.ym.mec.biz.dal.dao.ChildrenDayDegreeInfoDao">
  4. <resultMap id="ChildrenDayDegreeInfo" type="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo">
  5. <!--@mbg.generated-->
  6. <!--@Table children_day_degree_info-->
  7. <id column="id_" property="id"/>
  8. <result column="reserve_id_" property="reserveId"/>
  9. <result column="user_id_" property="userId"/>
  10. <result column="subject_id_" property="subjectId"/>
  11. <result column="grade_level_" property="gradeLevel"/>
  12. <result column="grade_price_" property="gradePrice"/>
  13. <result column="theory_level_" property="theoryLevel"/>
  14. <result column="theory_price_" property="theoryPrice"/>
  15. <result column="vip_1v1_price_" property="vip1v1Price"/>
  16. <result column="vip_1v2_price_" property="vip1v2Price"/>
  17. <result column="theory_course_price_" property="theoryCoursePrice"/>
  18. <result column="total_amount_" property="totalAmount"/>
  19. <result column="order_id_" property="orderId"/>
  20. <result column="create_time_" property="createTime"/>
  21. <result column="update_time_" property="updateTime"/>
  22. </resultMap>
  23. <select id="get" parameterType="java.lang.Integer" resultMap="ChildrenDayDegreeInfo">
  24. <!--@mbg.generated-->
  25. select *
  26. from children_day_degree_info
  27. where id_ = #{id}
  28. </select>
  29. <delete id="delete" parameterType="java.lang.Integer">
  30. <!--@mbg.generated-->
  31. delete from children_day_degree_info
  32. where id_ = #{id}
  33. </delete>
  34. <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo"
  35. useGeneratedKeys="true">
  36. <!--@mbg.generated-->
  37. insert into children_day_degree_info (reserve_id_, user_id_, subject_id_, grade_level_, grade_price_,
  38. theory_level_,theory_price_, vip_1v1_price_, vip_1v2_price_, theory_course_price_, total_amount_,order_id_,
  39. create_time_, update_time_)
  40. values (#{reserveId}, #{userId}, #{subjectId}, #{gradeLevel}, #{gradePrice}, #{theoryLevel},
  41. #{theoryPrice}, #{vip1v1Price}, #{vip1v2Price}, #{theoryCoursePrice}, #{totalAmount},#{orderId},
  42. NOW(), NOW())
  43. </insert>
  44. <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo">
  45. <!--@mbg.generated-->
  46. update children_day_degree_info
  47. <set>
  48. <if test="reserveId != null">
  49. reserve_id_ = #{reserveId},
  50. </if>
  51. <if test="userId != null">
  52. user_id_ = #{userId},
  53. </if>
  54. <if test="subjectId != null">
  55. subject_id_ = #{subjectId},
  56. </if>
  57. <if test="gradeLevel != null">
  58. grade_level_ = #{gradeLevel},
  59. </if>
  60. <if test="gradePrice != null">
  61. grade_price_ = #{gradePrice},
  62. </if>
  63. <if test="theoryLevel != null">
  64. theory_level_ = #{theoryLevel},
  65. </if>
  66. <if test="theoryPrice != null">
  67. theory_price_ = #{theoryPrice},
  68. </if>
  69. <if test="vip1v1Price != null">
  70. vip_1v1_price_ = #{vip1v1Price},
  71. </if>
  72. <if test="vip1v2Price != null">
  73. vip_1v2_price_ = #{vip1v2Price},
  74. </if>
  75. <if test="theoryCoursePrice != null">
  76. theory_course_price_ = #{theoryCoursePrice},
  77. </if>
  78. <if test="totalAmount != null">
  79. total_amount_ = #{totalAmount},
  80. </if>
  81. <if test="orderId != null">
  82. order_id_ = #{orderId},
  83. </if>
  84. <if test="createTime != null">
  85. create_time_ = #{createTime},
  86. </if>
  87. <if test="updateTime != null">
  88. update_time_ = NOW(),
  89. </if>
  90. </set>
  91. where id_ = #{id}
  92. </update>
  93. <!-- 分页查询 -->
  94. <select id="queryPage" resultMap="ChildrenDayDegreeInfo" parameterType="map">
  95. SELECT * FROM children_day_degree_info
  96. <include refid="global.limit"/>
  97. </select>
  98. <!-- 查询当前表的总记录数 -->
  99. <select id="queryCount" resultType="int">
  100. SELECT COUNT(*)
  101. FROM children_day_degree_info
  102. </select>
  103. </mapper>