|
|
@@ -780,4 +780,141 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
subscribe_id = #{subscribeId}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="listUserApply" parameterType="com.zhongzheng.modules.user.bo.UserApplyRecordBo" resultType="com.zhongzheng.modules.user.vo.UserApplyRecordVo">
|
|
|
+ SELECT
|
|
|
+ us.subscribe_id,
|
|
|
+ us.exam_status,
|
|
|
+ us.result as applyStatus,
|
|
|
+ us.performance,
|
|
|
+ us.create_time,
|
|
|
+ g.goods_name,
|
|
|
+ CONCAT(cet.education_name,'-',cb.business_name,cpt.project_name) AS businessName,
|
|
|
+ m.category_name AS majorName,
|
|
|
+ us.subscribe_status,
|
|
|
+ us.apply_site_exam_time AS applyTime,
|
|
|
+ us.apply_site_start_time AS applyStarTime,
|
|
|
+ us.apply_site_end_time AS applyEndTime,
|
|
|
+ CASE
|
|
|
+ WHEN (
|
|
|
+ SELECT
|
|
|
+ COUNT( usu.order_goods_id )
|
|
|
+ FROM
|
|
|
+ user_subscribe usu
|
|
|
+ WHERE
|
|
|
+ usu.user_id = us.user_id
|
|
|
+ AND usu.order_goods_id = us.order_goods_id
|
|
|
+ AND usu.subscribe_status = 1
|
|
|
+ ) = 1
|
|
|
+ THEN 1
|
|
|
+ WHEN (
|
|
|
+ SELECT
|
|
|
+ COUNT( usu.order_goods_id )
|
|
|
+ FROM
|
|
|
+ user_subscribe usu
|
|
|
+ WHERE
|
|
|
+ usu.user_id = us.user_id
|
|
|
+ AND usu.order_goods_id = us.order_goods_id
|
|
|
+ AND usu.subscribe_status = 1
|
|
|
+ ) >1
|
|
|
+ THEN 2
|
|
|
+ ELSE 0 END
|
|
|
+ AS applyNew
|
|
|
+ FROM user_subscribe us
|
|
|
+ LEFT JOIN order_goods og ON us.order_goods_id = og.order_goods_id
|
|
|
+ LEFT JOIN goods g ON og.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
+ LEFT JOIN major m ON g.major_id = m.id
|
|
|
+ WHERE 1=1 AND us.exam_status != 0
|
|
|
+ <if test="userId != null and userId !='' ">
|
|
|
+ AND us.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="applyStartTime != null and applyStartTime !=''">
|
|
|
+ AND us.apply_site_exam_time >= #{applyStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="applyEndTime != null and applyEndTime !=''">
|
|
|
+ AND us.apply_site_exam_time <= #{applyEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="educationTypeId != null and educationTypeId !='' ">
|
|
|
+ AND cet.id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId !='' ">
|
|
|
+ AND cb.id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="majorId != null and majorId !='' ">
|
|
|
+ AND m.id = #{majorId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsName != null and goodsName !='' ">
|
|
|
+ AND g.goods_name = #{goodsName}
|
|
|
+ </if>
|
|
|
+ <if test="applyStatus != null ">
|
|
|
+ AND us.result = #{applyStatus}
|
|
|
+ </if>
|
|
|
+ <if test="applyNew != null and applyNew == 1">
|
|
|
+ AND (
|
|
|
+ SELECT
|
|
|
+ COUNT( usu.order_goods_id )
|
|
|
+ FROM
|
|
|
+ user_subscribe usu
|
|
|
+ WHERE
|
|
|
+ usu.user_id = us.user_id
|
|
|
+ AND usu.order_goods_id = us.order_goods_id
|
|
|
+ AND usu.subscribe_status = 1
|
|
|
+ ) = 1
|
|
|
+ </if>
|
|
|
+ <if test="applyNew != null and applyNew == 0">
|
|
|
+ AND (
|
|
|
+ SELECT
|
|
|
+ COUNT( usu.order_goods_id )
|
|
|
+ FROM
|
|
|
+ user_subscribe usu
|
|
|
+ WHERE
|
|
|
+ usu.user_id = us.user_id
|
|
|
+ AND usu.order_goods_id = us.order_goods_id
|
|
|
+ AND usu.subscribe_status = 1
|
|
|
+ ) > 1
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listPromise" parameterType="com.zhongzheng.modules.user.bo.UserPromiseRecordBo" resultType="com.zhongzheng.modules.user.vo.UserPromiseRecordVo">
|
|
|
+ SELECT
|
|
|
+ up.id,
|
|
|
+ up.create_time as uploadTime,
|
|
|
+ up.key_value,
|
|
|
+ g.goods_name,
|
|
|
+ CONCAT(cet.education_name,'-',cb.business_name,cpt.project_name) AS businessName,
|
|
|
+ m.category_name AS majorName,
|
|
|
+ 1 AS signStatus
|
|
|
+ FROM
|
|
|
+ user_profile up
|
|
|
+ LEFT JOIN goods g ON up.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
+ LEFT JOIN major m ON g.major_id = m.id
|
|
|
+ WHERE up.`status` != -1 AND up.current_status = 1
|
|
|
+ <if test="userId != null and userId !='' ">
|
|
|
+ AND up.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="uploadStartTime != null and uploadStartTime !=''">
|
|
|
+ AND up.create_time >= #{uploadStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="uploadEndTime != null and uploadEndTime !=''">
|
|
|
+ AND up.create_time <= #{uploadEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="educationTypeId != null and educationTypeId !='' ">
|
|
|
+ AND cet.id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId !='' ">
|
|
|
+ AND cb.id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="majorId != null and majorId !='' ">
|
|
|
+ AND m.id = #{majorId}
|
|
|
+ </if>
|
|
|
+ <if test="goodsName != null and goodsName !='' ">
|
|
|
+ AND g.goods_name = #{goodsName}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|