ChildrenDayDegreeInfoDao.xml 4.8 KB

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