1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?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.order.mapper.OrderBusinessConfigMapper">
- <resultMap type="com.zhongzheng.modules.order.domain.OrderBusinessConfig" id="OrderBusinessConfigResult">
- <result property="id" column="id"/>
- <result property="businessId" column="business_id"/>
- <result property="configName" column="config_name"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="status" column="status"/>
- <result property="gradeType" column="grade_type"/>
- <result property="mainImg" column="main_img"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.order.vo.OrderBusinessConfigVo" id="OrderBusinessConfigVoResult">
- <result property="id" column="id"/>
- <result property="educationTypeId" column="education_type_id"/>
- <result property="businessId" column="business_id"/>
- <result property="projectId" column="project_id"/>
- <result property="configName" column="config_name"/>
- <result property="aliasName" column="alias_name"/>
- <result property="businessName" column="business_name"/>
- <result property="educationName" column="education_name"/>
- <result property="projectName" column="project_name"/>
- <result property="gradeType" column="grade_type"/>
- <result property="mainImg" column="main_img"/>
- </resultMap>
- <select id="getList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">
- SELECT
- obc.*,
- cb.alias_name,
- cb.business_name,
- cpt.project_name,
- cet.education_name,
- cpt.education_id as education_type_id,
- cb.project_id
- FROM
- order_business_config obc
- LEFT JOIN course_business cb ON obc.business_id = cb.id
- LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
- LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
- WHERE
- 1=1
- and cet.`status` = 1
- and cb.`status` = 1
- <if test="status != null and status != ''">
- and obc.`status` = #{status}
- </if>
- <if test="gradeType != null and gradeType != ''">
- and obc.grade_type = #{gradeType}
- </if>
- <if test="businessId != null and businessId != ''">
- and obc.business_id = #{businessId}
- </if>
- <if test="projectId != null and projectId != ''">
- and cpt.id = #{projectId}
- </if>
- <if test="educationId != null and educationId != ''">
- and cet.id = #{educationId}
- </if>
- <if test="businessName != null and businessName != ''">
- and cb.business_name = #{businessName}
- </if>
- <if test="projectName != null and projectName != ''">
- and cpt.project_name = #{projectName}
- </if>
- <if test="educationName != null and educationName != ''">
- and cet.education_name = #{educationName}
- </if>
- <if test="configName != null and configName != ''">
- AND obc.config_name like concat('%', #{configName}, '%')
- </if>
- <if test="subjectId != null and subjectId != ''">
- and (SELECT COUNT(obcg.id) FROM order_business_config_goods obcg where obcg.subject_id = #{subjectId} AND obcg.config_id = obc.id AND obcg.`status` = 1) > 0
- </if>
- ORDER BY obc.config_sort DESC
- </select>
- <select id="getDetail" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">
- SELECT
- obc.*,
- cb.alias_name,
- cb.business_name,
- cpt.project_name,
- cet.education_name
- FROM
- order_business_config obc
- LEFT JOIN course_business cb ON obc.business_id = cb.id
- LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
- LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
- WHERE
- obc.id = #{id}
- </select>
- </mapper>
|