| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.zhongzheng.modules.grade.mapper.ClassGradeMapper">
- <resultMap type="com.zhongzheng.modules.grade.domain.ClassGrade" id="ClassGradeResult">
- <result property="classId" column="class_id"/>
- <result property="classStatus" column="class_status"/>
- <result property="officialName" column="official_name"/>
- <result property="className" column="class_name"/>
- <result property="studentUpper" column="student_upper"/>
- <result property="learningTimeStart" column="learning_time_start"/>
- <result property="learningStatus" column="learning_status"/>
- <result property="status" column="status"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="examineId" column="examine_id"/>
- <result property="areasId" column="areas_id"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="sysUserId" column="sys_user_id"/>
- <result property="interfacePushId" column="interface_push_id"/>
- <result property="remark" column="remark"/>
- <result property="interfaceAccountId" column="interface_account_id"/>
- <result property="interfacePeriodId" column="interface_period_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
- <result property="classId" column="class_id"/>
- <result property="classStatus" column="class_status"/>
- <result property="officialName" column="official_name"/>
- <result property="className" column="class_name"/>
- <result property="studentUpper" column="student_upper"/>
- <result property="learningTimeStart" column="learning_time_start"/>
- <result property="learningStatus" column="learning_status"/>
- <result property="status" column="status"/>
- <result property="classStartTime" column="class_start_time"/>
- <result property="classEndTime" column="class_end_time"/>
- <result property="examineId" column="examine_id"/>
- <result property="areasId" column="areas_id"/>
- <result property="sysUserId" column="sys_user_id"/>
- <result property="interfacePushId" column="interface_push_id"/>
- <result property="remark" column="remark"/>
- <result property="interfaceAccountId" column="interface_account_id"/>
- <result property="interfacePeriodId" column="interface_period_id"/>
- <result property="interfaceAccountName" column="interface_account_name"/>
- <result property="interfacePeriodName" column="interface_period_name"/>
- <result property="interfacePushName" column="interface_push_name"/>
- <result property="studentNum" column="student_num"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.goods.vo.GoodsVo" id="GoodsResultVo">
- <result property="goodsId" column="goods_id"/>
- <result property="year" column="year"/>
- <result property="supplyId" column="supply_id"/>
- <result property="goodsType" column="goods_type"/>
- <result property="educationTypeId" column="education_type_id"/>
- <result property="businessId" column="business_id"/>
- <result property="schoolId" column="school_id"/>
- <result property="majorId" column="major_id"/>
- <result property="goodsName" column="goods_name"/>
- <result property="standPrice" column="stand_price"/>
- <result property="lowestPrice" column="lowest_price"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="status" column="status"/>
- <result property="validityStartTime" column="validity_start_time"/>
- <result property="validityEndTime" column="validity_end_time"/>
- <result property="studyStartTime" column="study_start_time"/>
- <result property="studyEndTime" column="study_end_time"/>
- <result property="certificateIds" column="certificate_ids"/>
- <result property="introduce" column="introduce"/>
- <result property="suitableObject" column="suitable_object"/>
- <result property="buyNote" column="buy_note"/>
- <result property="pcDetailHtml" column="pc_detail_html"/>
- <result property="mobileDetailHtml" column="mobile_detail_html"/>
- <result property="goodsStatus" column="goods_status"/>
- <result property="coverUrl" column="cover_url"/>
- <result property="classHours" column="class_hours"/>
- <result property="standPriceJson" column="stand_price_json"/>
- <result property="code" column="code"/>
- <result property="projectId" column="project_id"/>
- <result property="goodsAuditionConfig" column="goods_audition_config"/>
- <result property="goodsPhotographConfig" column="goods_photograph_config"/>
- <result property="goodsPlayConfig" column="goods_play_config"/>
- <result property="goodsExamConfig" column="goods_exam_config"/>
- <result property="supplyName" column="supply_name"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="businessName" column="business_name"/>
- <result property="schoolName" column="school_name"/>
- <result property="categoryName" column="category_name"/>
- <result property="handoutsId" column="handouts_id"/>
- <result property="templateType" column="template_type"/>
- </resultMap>
- <select id="queryList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeVoResult">
- SELECT
- g.*,
- (SELECT name FROM class_grade_interface i where g.interface_push_id = i.id) as interface_push_name,
- (SELECT name FROM class_grade_interface i where g.interface_account_id = i.id) as interface_account_name,
- (SELECT name FROM class_grade_interface i where g.interface_period_id = i.id) as interface_period_name,
- (SELECT nick_name FROM sys_user u where g.sys_user_id = u.user_id) as nick_name,
- (SELECT area_name FROM apply_areas a where a.area_id = g.areas_id) as area_name,
- (SELECT area_name FROM apply_areas a where a.area_id = g.city_id) as city_name,
- (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.class_id and a.status =1) as student_num
- FROM
- class_grade g
- where 1=1
- <if test="status != null and status.size()!=0 ">
- AND g.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="classId != null and classId !=0 ">
- AND g.class_id = #{classId}
- </if>
- <if test="className != null and className !='' ">
- AND g.class_name like concat('%', #{className}, '%')
- </if>
- <if test="classStartTime != null and classStartTime !=0 ">
- AND #{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time
- </if>
- <if test="educationTypeId != null and educationTypeId !='' ">
- AND (
- SELECT
- COUNT(*)
- FROM
- class_grade_goods s
- LEFT JOIN goods d ON s.goods_id = d.goods_id
- WHERE
- 1 = 1
- AND g.class_id = s.grade_id
- AND d.education_type_id =#{educationTypeId}
- ) >0
- </if>
- <if test="businessId != null and businessId !='' ">
- AND (
- SELECT
- COUNT(*)
- FROM
- class_grade_goods s
- LEFT JOIN goods d ON s.goods_id = d.goods_id
- WHERE
- 1 = 1
- AND g.class_id = s.grade_id
- AND d.business_id =#{businessId}
- ) >0
- </if>
- <if test="schoolId != null and schoolId !='' ">
- AND (
- SELECT
- COUNT(*)
- FROM
- class_grade_goods s
- LEFT JOIN goods d ON s.goods_id = d.goods_id
- WHERE
- 1 = 1
- AND g.class_id = s.grade_id
- AND d.school_id =#{schoolId}
- ) >0
- </if>
- <if test="majorId != null and majorId !='' ">
- AND (
- SELECT
- COUNT(*)
- FROM
- class_grade_goods s
- LEFT JOIN goods d ON s.goods_id = d.goods_id
- WHERE
- 1 = 1
- AND g.class_id = s.grade_id
- AND d.major_id =#{majorId}
- ) >0
- </if>
- order by g.update_time desc
- </select>
- <select id="queryGoodsList" parameterType="Long" resultMap="GoodsResultVo">
- SELECT
- g.*,
- ps.supply_name,
- cet.education_name,
- cpt.project_name,
- cb.business_name,
- s.school_name,
- m.category_name,
- ot.type AS template_type
- FROM
- goods g
- LEFT JOIN pay_supply ps ON g.supply_id = ps.supply_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 school s ON s.id = g.school_id
- LEFT JOIN major m ON g.major_id = m.id
- LEFT JOIN order_input_template ot ON cb.template_status = ot.id
- LEFT JOIN class_grade_goods o ON o.goods_id = g.goods_id
- WHERE
- 1 = 1
- AND o.grade_id =#{classId}
- </select>
- </mapper>
|