|
@@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="goodsCode" column="goods_code"/>
|
|
|
<result property="goodsName" column="goods_name"/>
|
|
|
<result property="standPrice" column="stand_price"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.user.vo.UserExamGoodsSupplementVo" id="UserExamGoodsSupplementVo">
|
|
@@ -34,11 +37,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="doNumber" column="do_number"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
- <result property="code" column="code"/>
|
|
|
+ <result property="code" column="goods_code"/>
|
|
|
<result property="goodsName" column="goods_name"/>
|
|
|
<result property="standPrice" column="stand_price"/>
|
|
|
<result property="status" column="status"/>
|
|
|
<result property="timeStatus" column="time_status"/>
|
|
|
+ <result property="makeStartTime" column="make_start_time"/>
|
|
|
+ <result property="makeEndTime" column="make_end_time"/>
|
|
|
+ <result property="timeStatus" column="time_status"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="listUserExam" parameterType="com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo" resultMap="UserExamGoodsVo">
|
|
@@ -46,14 +55,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
*,
|
|
|
(SELECT g.goods_name FROM goods g where ueg.goods_id = g.goods_id) as goods_name,
|
|
|
(SELECT g.code FROM goods g where ueg.goods_id = g.goods_id) as goods_code,
|
|
|
- (SELECT g.stand_price FROM goods g where ueg.goods_id = g.goods_id) as stand_price
|
|
|
+ (SELECT g.stand_price FROM goods g where ueg.goods_id = g.goods_id) as stand_price,
|
|
|
+ (SELECT cet.education_name FROM goods g LEFT JOIN course_education_type cet on cet.id = g.education_type_id where ueg.goods_id = g.goods_id) as education_name,
|
|
|
+ (SELECT cpt.project_name FROM goods g LEFT JOIN course_project_type cpt on cpt.id = g.project_id where ueg.goods_id = g.goods_id) as project_name,
|
|
|
+ (SELECT cb.business_name FROM goods g LEFT JOIN course_business cb on cb.id = g.business_id where ueg.goods_id = g.goods_id) as business_name
|
|
|
FROM
|
|
|
user_exam_goods ueg
|
|
|
WHERE
|
|
|
ueg.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getUserExam" parameterType="map" resultMap="UserExamGoodsVo">
|
|
|
+ <select id="getUserExam" parameterType="map" resultMap="UserExamGoodsSupplementVo">
|
|
|
SELECT
|
|
|
*,
|
|
|
(SELECT g.goods_name FROM goods g where uegs.goods_id = g.goods_id) as goods_name,
|
|
@@ -61,7 +73,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
(SELECT g.stand_price FROM goods g where uegs.goods_id = g.goods_id) as stand_price,
|
|
|
(SELECT g.make_start_time FROM goods g where uegs.goods_id = g.goods_id) as make_start_time,
|
|
|
(SELECT g.make_end_time FROM goods g where uegs.goods_id = g.goods_id) as make_end_time,
|
|
|
- (case WHEN (SELECT COUNT(g.goods_id) FROM goods g where uegs.goods_id = g.goods_id and unix_timestamp(now()) BETWEEN g.make_start_time and g.make_end_time) >0 then 1 ELSE 0 end) as time_status
|
|
|
+ (case WHEN (SELECT COUNT(g.goods_id) FROM goods g where uegs.goods_id = g.goods_id and unix_timestamp(now()) BETWEEN g.make_start_time and g.make_end_time) >0 then 1 ELSE 0 end) as time_status,
|
|
|
+ (SELECT cet.education_name FROM goods g LEFT JOIN course_education_type cet on cet.id = g.education_type_id where uegs.goods_id = g.goods_id) as education_name,
|
|
|
+ (SELECT cpt.project_name FROM goods g LEFT JOIN course_project_type cpt on cpt.id = g.project_id where uegs.goods_id = g.goods_id) as project_name,
|
|
|
+ (SELECT cb.business_name FROM goods g LEFT JOIN course_business cb on cb.id = g.business_id where uegs.goods_id = g.goods_id) as business_name
|
|
|
FROM
|
|
|
user_exam_goods_supplement uegs
|
|
|
WHERE
|