<?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.qmth.sop.business.mapper.TBCrmDetailMapper">

    <select id="list" resultType="com.qmth.sop.business.entity.TBCrmDetail">
        select t.*,tbsi.status as sopStatus from t_b_crm_detail t
        left join t_f_custom_flow_entity tfcfe on tfcfe.code = t.sop_no
        left join t_b_sop_info tbsi on tbsi.sop_no = t.sop_no
        where t.crm_no = #{crmNo}
        order by t.course_name
    </select>
</mapper>
