|
@@ -13,8 +13,12 @@
|
|
<result column="status_" property="status"/>
|
|
<result column="status_" property="status"/>
|
|
<result column="start_time_" property="startTime"/>
|
|
<result column="start_time_" property="startTime"/>
|
|
<result column="end_time_" property="endTime"/>
|
|
<result column="end_time_" property="endTime"/>
|
|
|
|
+ <result column="order_id_" property="orderId"/>
|
|
|
|
+ <result column="change_order_id_" property="changeOrderId"/>
|
|
|
|
+ <result column="operation_" property="operation"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
|
|
+ <result column="del_flag_" property="delFlag"/>
|
|
<result column="goods_name_" property="goodsName"/>
|
|
<result column="goods_name_" property="goodsName"/>
|
|
<result column="specification_" property="specification"/>
|
|
<result column="specification_" property="specification"/>
|
|
<result column="goods_brand_" property="goodsBrand"/>
|
|
<result column="goods_brand_" property="goodsBrand"/>
|
|
@@ -37,11 +41,11 @@
|
|
<!--@mbg.generated-->
|
|
<!--@mbg.generated-->
|
|
insert into student_instrument
|
|
insert into student_instrument
|
|
(student_id_,organ_id_,goods_id_,goods_category_id_,goods_category_name_,goods_name_,goods_brand_,specification_,goods_img_,
|
|
(student_id_,organ_id_,goods_id_,goods_category_id_,goods_category_name_,goods_name_,goods_brand_,specification_,goods_img_,
|
|
- status_, start_time_, end_time_, create_time_, update_time
|
|
|
|
|
|
+ status_,order_id_,change_order_id_,operation_, start_time_, end_time_, create_time_, update_time
|
|
)
|
|
)
|
|
values
|
|
values
|
|
(#{studentId},#{organId},#{goodsId},#{goodsCategoryId},#{goodsCategoryName},#{goodsName},#{goodsBrand},#{specification},#{goodsImg},
|
|
(#{studentId},#{organId},#{goodsId},#{goodsCategoryId},#{goodsCategoryName},#{goodsName},#{goodsBrand},#{specification},#{goodsImg},
|
|
- #{status}, #{startTime}, #{endTime}, NOW(), NOW()
|
|
|
|
|
|
+ #{status},#{orderId},#{changeOrderId},#{operation}, #{startTime}, #{endTime}, NOW(), NOW()
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentInstrument">
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentInstrument">
|
|
@@ -72,18 +76,21 @@
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
status_ = #{status},
|
|
status_ = #{status},
|
|
</if>
|
|
</if>
|
|
- <if test="startTime != null">
|
|
|
|
- start_time_ = #{startTime},
|
|
|
|
|
|
+ <if test="operation != null">
|
|
|
|
+ operation_ = #{operation},
|
|
</if>
|
|
</if>
|
|
- <if test="endTime != null">
|
|
|
|
- end_time_ = #{endTime},
|
|
|
|
|
|
+ start_time_ = #{startTime},
|
|
|
|
+ end_time_ = #{endTime},
|
|
|
|
+ <if test="changeOrderId != null">
|
|
|
|
+ change_order_id_ = #{changeOrderId},
|
|
</if>
|
|
</if>
|
|
<if test="createTime != null">
|
|
<if test="createTime != null">
|
|
create_time_ = #{createTime},
|
|
create_time_ = #{createTime},
|
|
</if>
|
|
</if>
|
|
- <if test="updateTime != null">
|
|
|
|
- update_time = #{updateTime},
|
|
|
|
|
|
+ <if test="delFlag != null">
|
|
|
|
+ del_flag_ = #{delFlag},
|
|
</if>
|
|
</if>
|
|
|
|
+ update_time = NOW(),
|
|
</set>
|
|
</set>
|
|
where id_ = #{id}
|
|
where id_ = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -131,20 +138,24 @@
|
|
<if test="specification != null">
|
|
<if test="specification != null">
|
|
AND si.specification_ LIKE CONCAT('%',#{specification},'%')
|
|
AND si.specification_ LIKE CONCAT('%',#{specification},'%')
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ AND si.status_ = #{status}
|
|
|
|
+ </if>
|
|
<if test="search != null">
|
|
<if test="search != null">
|
|
AND (si.student_id_ = #{search} OR su.phone_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
|
|
AND (si.student_id_ = #{search} OR su.phone_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%'))
|
|
</if>
|
|
</if>
|
|
|
|
+ AND si.del_flag_ = 0
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
<insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
insert into student_instrument
|
|
insert into student_instrument
|
|
(student_id_,organ_id_,goods_id_,goods_category_id_,goods_category_name_,goods_name_,goods_brand_,specification_,goods_img_,
|
|
(student_id_,organ_id_,goods_id_,goods_category_id_,goods_category_name_,goods_name_,goods_brand_,specification_,goods_img_,
|
|
- status_, start_time_, end_time_, create_time_, update_time)
|
|
|
|
|
|
+ order_id_,change_order_id_,status_, start_time_, end_time_, create_time_, update_time)
|
|
VALUE
|
|
VALUE
|
|
<foreach collection="studentInstruments" item="item" separator=",">
|
|
<foreach collection="studentInstruments" item="item" separator=",">
|
|
(#{item.studentId},#{item.organId},#{item.goodsId},#{item.goodsCategoryId},#{item.goodsCategoryName},#{item.goodsName},#{item.goodsBrand},#{item.specification},#{item.goodsImg},
|
|
(#{item.studentId},#{item.organId},#{item.goodsId},#{item.goodsCategoryId},#{item.goodsCategoryName},#{item.goodsName},#{item.goodsBrand},#{item.specification},#{item.goodsImg},
|
|
- #{item.status}, #{item.startTime},
|
|
|
|
|
|
+ #{item.orderId},#{item.changeOrderId},#{item.status}, #{item.startTime},
|
|
#{item.endTime}, NOW(), NOW())
|
|
#{item.endTime}, NOW(), NOW())
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
@@ -158,8 +169,55 @@
|
|
</update>
|
|
</update>
|
|
<select id="getListByEndTime" resultMap="StudentInstrument">
|
|
<select id="getListByEndTime" resultMap="StudentInstrument">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- SELECT * FROM student_instrument WHERE end_time_ >= #{startTime} AND end_time_ <= #{endTime}
|
|
|
|
- ]]>
|
|
|
|
|
|
+ SELECT *
|
|
|
|
+ FROM student_instrument
|
|
|
|
+ WHERE end_time_ >= #{startTime}
|
|
|
|
+ AND end_time_ <= #{endTime}
|
|
|
|
+ ]]>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getByOrderId" resultMap="StudentInstrument">
|
|
|
|
+ SELECT *
|
|
|
|
+ FROM student_instrument
|
|
|
|
+ WHERE change_order_id_ = #{orderId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getStudentInstrument" resultMap="StudentInstrument">
|
|
|
|
+ SELECT *
|
|
|
|
+ FROM student_instrument
|
|
|
|
+ WHERE student_id_ = #{studentId}
|
|
|
|
+ AND goods_id_ = #{goodsId}
|
|
|
|
+ AND del_flag_ = 0
|
|
|
|
+ ORDER BY id_ DESC
|
|
|
|
+ LIMIT 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getOldStudentInstrument" resultMap="StudentInstrument">
|
|
|
|
+ SELECT spo.user_id_ student_id_,
|
|
|
|
+ spo.organ_id_,
|
|
|
|
+ g.id_ goods_id_,
|
|
|
|
+ g.goods_category_id_,
|
|
|
|
+ gc.name_ goods_category_name_,
|
|
|
|
+ g.name_ goods_name_,
|
|
|
|
+ g.brand_ goods_brand_,
|
|
|
|
+ g.specification_,
|
|
|
|
+ g.image_ goods_img_,
|
|
|
|
+ spo.create_time_ start_time_,
|
|
|
|
+ DATE_ADD(spo.create_time_, INTERVAL 1 YEAR) end_time_,
|
|
|
|
+ spo.id_ order_id_
|
|
|
|
+ FROM student_payment_order_detail spod
|
|
|
|
+ LEFT JOIN student_payment_order spo ON spo.id_ = spod.payment_order_id_
|
|
|
|
+ LEFT JOIN student_payment_order_detail spod2 ON spod2.payment_order_id_ = spo.id_
|
|
|
|
+ LEFT JOIN goods g ON g.id_ = spod2.goods_id_list_
|
|
|
|
+ LEFT JOIN goods_category gc on g.goods_category_id_ = gc.id_
|
|
|
|
+ WHERE spo.status_ = 'SUCCESS'
|
|
|
|
+ AND spod2.type_ = 'MUSICAL'
|
|
|
|
+ AND (spod.goods_id_list_ IN ('437', '438', '439', '440', '441', '442', '443') OR
|
|
|
|
+ FIND_IN_SET('76', spod.goods_id_list_))
|
|
|
|
+ <if test="startTime != null ">
|
|
|
|
+ AND spo.pay_time_ >= #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY spo.create_time_ ASC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|