|
@@ -15,5 +15,80 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="code" column="code"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.bank.vo.QuestionModuleVo" id="QuestionModuleResultVo">
|
|
|
+ <result property="moduleExamId" column="module_exam_id"/>
|
|
|
+ <result property="prefixName" column="prefix_name"/>
|
|
|
+ <result property="moduleName" column="module_name"/>
|
|
|
+ <result property="publishStatus" column="publish_status"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="code" column="code"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="educationTypeId" column="education_type_id"/>
|
|
|
+ <result property="businessId" column="business_id"/>
|
|
|
+ <result property="subjectId" column="subject_id"/>
|
|
|
+ <result property="projectId" column="project_id"/>
|
|
|
+ <result property="subjectName" column="subject_name"/>
|
|
|
+ <collection property="goodsList" column="module_exam_id" select="findGoodsList"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="findGoodsList" resultMap="GoodsListResult">
|
|
|
+ SELECT
|
|
|
+ g.goods_name,
|
|
|
+ g.goods_id
|
|
|
+ FROM
|
|
|
+ goods_attached ga
|
|
|
+ LEFT JOIN goods g ON ga.goods_id = g.goods_id
|
|
|
+ WHERE
|
|
|
+ ga.major_id =#{module_exam_id} AND ga.type = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap type="com.zhongzheng.modules.bank.vo.ExamGoodsVo" id="GoodsListResult">
|
|
|
+ <result property="goodsName" column="goods_name"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
+ <select id="getList" parameterType="com.zhongzheng.modules.bank.bo.QuestionModuleQueryBo" resultMap="QuestionModuleResultVo">
|
|
|
+ SELECT
|
|
|
+ qm.*,
|
|
|
+ qb.education_type_id,
|
|
|
+ qb.business_id,
|
|
|
+ qb.project_id,
|
|
|
+ qb.subject_id,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ cs.subject_name
|
|
|
+ FROM
|
|
|
+ question_module qm
|
|
|
+ LEFT JOIN question_business qb ON qm.module_exam_id = qb.major_id
|
|
|
+ AND qb.type = 4
|
|
|
+ LEFT JOIN course_education_type cet ON qb.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON qb.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON qb.business_id = cb.id
|
|
|
+ LEFT JOIN course_subject cs ON cs.id = qb.subject_id where 1=1
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
+ AND cet.id = #{educationTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null and subjectId != ''">
|
|
|
+ AND cs.id = #{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND cb.id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
+ AND cpt.id = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="publishStatus != null and publishStatus != ''">
|
|
|
+ AND qm.publish_status = #{publishStatus}
|
|
|
+ </if>
|
|
|
+ <if test="moduleName != null and moduleName != ''">
|
|
|
+ AND qm.module_name like concat('%', #{moduleName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="prefixName != null and prefixName != ''">
|
|
|
+ AND qm.prefix_name like concat('%', #{prefixName}, '%')
|
|
|
+ </if>
|
|
|
+ ORDER BY qm.module_exam_id DESC
|
|
|
+ </select>
|
|
|
</mapper>
|