msql中左连接查询数据未出显 eip项目

 select sum(a.duration_time) as quantity,b.dept_name,b.user_quantity from blade_employee_training_record_dept_user_quantity b
        LEFT JOIN (select * from blade_employee_training_record_detail
        where tenant_id=#{tenantId}
        <if test="startDate !=null and startDate !='' ">
            and end_training_date >= #{startDate}
        </if>
        <if test="startDate !=null and startDate !='' ">
            and end_training_date >= #{startDate}
        </if>
        ) a  on a.dept_name=b.dept_name
        GROUP BY b.dept_name

  

posted @ 2021-06-04 10:20  红尘沙漏  阅读(40)  评论(0编辑  收藏  举报