<?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="org.jeecg.modules.system.app.mapper.AppCoursesPriceRulesMapper">
    <select id="selectRuleIdsByCourseId" resultType="string">
        SELECT id FROM nm_courses_price_rules WHERE courses_id = #{coursesId}
    </select>
    <select id="findByClassPrice" resultType="org.jeecg.modules.quartz.vo.JobExtendedClassNoticeVo">
        select b.user_open_id,d.`name` as siteName from nm_courses_verification_record  a
        LEFT JOIN nm_order b on b.id =a.order_id
        LEFT JOIN nm_courses c on a.courses_id = c.id
        LEFT JOIN nm_site d on  c.address_site_id =d.id
        where a.use_user_id = #{userId} and a.courses_price_rule_id = #{id} order by  a.create_time desc limit 1
    </select>
</mapper>