123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <?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.course.mapper.CourseBusinessMapper">
- <resultMap type="com.zhongzheng.modules.course.domain.CourseBusiness" id="CourseBusinessResult">
- <result property="id" column="id"/>
- <result property="businessName" column="business_name"/>
- <result property="remark" column="remark"/>
- <result property="projectId" column="project_id"/>
- <result property="schoolYear" column="school_year"/>
- <result property="status" column="status"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="goodsLearningOrder" column="goods_learning_order"/>
- <result property="profileTpUserIds" column="profile_tp_user_ids"/>
- <result property="periodUserIds" column="period_user_ids"/>
- <result property="periodConfirmUserIds" column="period_confirm_user_ids"/>
- <result property="refundUserIds" column="refund_user_ids"/>
- <result property="refundConfirmUserIds" column="refund_confirm_user_ids"/>
- <result property="sort" column="sort"/>
- <result property="goodsFieldJson" column="goods_field_json"/>
- <result property="aliasName" column="alias_name"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.course.vo.CourseBusinessVo" id="CourseBusinessVoResult">
- <result property="id" column="id"/>
- <result property="businessName" column="business_name"/>
- <result property="businessId" column="business_id"/>
- <result property="remark" column="remark"/>
- <result property="projectId" column="project_id"/>
- <result property="schoolYear" column="school_year"/>
- <result property="status" column="status"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="educationId" column="education_id"/>
- <result property="templateStatus" column="template_status"/>
- <result property="templateName" column="template_name"/>
- <result property="goodsLearningOrder" column="goods_learning_order"/>
- <result property="profileTpUserIds" column="profile_tp_user_ids"/>
- <result property="periodUserIds" column="period_user_ids"/>
- <result property="periodConfirmUserIds" column="period_confirm_user_ids"/>
- <result property="refundUserIds" column="refund_user_ids"/>
- <result property="refundConfirmUserIds" column="refund_confirm_user_ids"/>
- <result property="sort" column="sort"/>
- <result property="goodsFieldJson" column="goods_field_json"/>
- <result property="aliasName" column="alias_name"/>
- </resultMap>
- <select id="queryList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultMap="CourseBusinessVoResult">
- SELECT
- b.*,
- e.education_name,
- e.id as education_id,
- p.project_name,
- t.name as template_name,
- p.id as project_id
- FROM
- course_business b
- LEFT JOIN course_project_type p on b.project_id =p.id
- LEFT JOIN course_education_type e ON p.education_id = e.id
- LEFT JOIN order_input_template t ON b.template_status = t.id
- where 1=1
- and p.status != -1
- and e.status != -1
- <if test="status != null and status.size()!=0 ">
- AND b.status in
- <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- <if test="businessName != null and businessName != ''">
- AND b.business_name = #{businessName}
- </if>
- <if test="encoder != null and encoder != ''">
- AND b.encoder = #{encoder}
- </if>
- <if test="projectId != null and projectId != ''">
- AND p.id = #{projectId}
- </if>
- <if test="educationId != null and educationId != ''">
- AND e.id = #{educationId}
- </if>
- <if test="id != null and id != ''">
- AND b.id = #{id}
- </if>
- order by b.sort
- </select>
- <select id="queryFullName" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultType="string">
- SELECT
- concat( e.education_name, b.business_name, p.project_name )
- FROM
- course_business b
- LEFT JOIN course_project_type p ON b.project_id = p.id
- LEFT JOIN course_education_type e ON p.education_id = e.id
- WHERE
- b.id = #{id}
- </select>
- <select id="queryFullId" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultMap="CourseBusinessVoResult">
- SELECT
- e.id as education_id,
- p.id AS project_id,
- b.id AS business_id
- FROM
- course_business b
- LEFT JOIN course_project_type p ON b.project_id = p.id
- LEFT JOIN course_education_type e ON p.education_id = e.id
- WHERE
- b.business_name = #{businessName}
- AND e.education_name = #{educationName}
- AND p.project_name = #{projectName}
- limit 1
- </select>
- <select id="getBusinessByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseBusiness">
- SELECT * FROM course_business WHERE encoder = #{encoder} and tenant_id = #{newTenantId}
- </select>
- <select id="getBusinessByIdTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseBusiness">
- SELECT b.*,t.name as templateName FROM course_business b
- LEFT JOIN order_input_template t ON b.template_status = t.id
- WHERE b.id = #{businessId} and b.tenant_id = #{tenantId}
- </select>
- <select id="queryAllList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultMap="CourseBusinessVoResult">
- SELECT
- b.id as business_id,
- b.business_name,
- b.alias_name,
- e.education_name,
- e.id as education_id,
- p.project_name,
- p.id as project_id
- FROM
- course_business b
- LEFT JOIN course_project_type p on b.project_id =p.id
- LEFT JOIN course_education_type e ON p.education_id = e.id
- where 1=1
- and p.status = 1
- and b.status = 1
- <if test="businessName != null and businessName != ''">
- AND b.business_name = #{businessName}
- </if>
- <if test="encoder != null and encoder != ''">
- AND b.encoder = #{encoder}
- </if>
- <if test="projectId != null and projectId != ''">
- AND p.id = #{projectId}
- </if>
- <if test="educationId != null and educationId != ''">
- AND e.id = #{educationId}
- </if>
- <if test="id != null and id != ''">
- AND b.id = #{id}
- </if>
- order by b.sort
- </select>
- </mapper>
|