Administrator
2021-08-31 08363052cecb30230a2c8b3eba791ca8d1be00a5
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -9,14 +9,10 @@
            bt.dept_name AS deptName,
            bt0.dept_name AS trainUnitName,
            bu.real_name realName,bu.phone,bu.cardid idCardNo,
            ke.start_time trainExamTime,ke.exam_name trainExamName,ke.exam_type examType,
            ke.start_time trainExamTime,if(ke.audit_status=1,ke.exam_name,"") trainExamName,ke.exam_type examType,
            "保安证" applyCard
        FROM
            sys_training_registration sr
        LEFT JOIN
            blade_dept bt
        ON
            sr.dept_id = bt.id
        LEFT JOIN
            blade_dept bt0
        ON
@@ -25,6 +21,10 @@
            blade_user bu
        on
            sr.user_id = bu.id
        LEFT JOIN
            blade_dept bt
        ON
            bu.dept_id = bt.id
        left join
            ksxt_exam ke
        on
@@ -32,6 +32,8 @@
        WHERE
            1=1
        and is_exam = 1
        and bu.is_train = 1
        and sr.cancel = 1
        <if test="trainingRegistration.trainingUnitId!=null and  trainingRegistration.trainingUnitId!=''">
            and sr.training_unit_id = #{trainingRegistration.trainingUnitId}
        </if>
@@ -126,4 +128,37 @@
            and candidate_no like concat('%', #{result},'%')
        </if>
    </select>
    <!--查询培训报名信息-->
    <select id="getTrainingRegistrationInfo" resultType="java.lang.Integer">
        select 1 from sys_training_registration
        where 1=1
        and cancel = 1
        and is_exam = 1
        <if test="trainingRegistration.userId!=null and trainingRegistration.userId!=''">
            and user_id = #{trainingRegistration.userId}
        </if>
        <if test="trainingRegistration.trainExamId!=null and trainingRegistration.trainExamId!=''">
            and train_exam_id = #{trainingRegistration.trainExamId}
        </if>
        limit 1
    </select>
    <!--查询已报名培训公司未关联考试的报名信息-->
    <select id="getTrainIds" resultType="java.lang.Long">
        SELECT
        str.id
        FROM
        sys_training_registration str
        left join
        blade_user bu
        on
        str.user_id = bu.id
        WHERE
        1=1
        and str.is_exam = 1
        and str.cancel = 1
        and bu.is_train = 1
        and str.train_exam_id is null
    </select>
</mapper>