<?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.stm.project.report.mapper.StProjectReportMapper">
<select id="queryStProjectReportVoByPage" resultType="org.jeecg.modules.stm.project.report.vo.StProjectReportVo">
		select
		distinct
		a.cre_type as creType ,
		a.plan_code as planCode ,
		a.project_name as projectName ,
		a.project_type as projectType ,
		a.exec_dep_code as execDepCode ,
		a.head_code as headCode ,
		a.plan_start_date as planStartDate ,
		a.plan_end_date as planEndDate ,
		a.approve_dep_code as approveDepCode,
		a.approve_user as approveUser ,
		a.project_desc as projectDesc ,
		a.project_aim as projectAim ,
		a.file_upload_path as fileUploadPath,
		a.approve_flag as approveFlag ,
		a.approve_time as approveTime ,
		(select depart_name from sys_depart c
		where c.id=a.exec_dep_code)
		as execDepName,
		(select realname from sys_user c where c.username=a.head_code) as
		headName,
		a.approve_des as approveDes ,
		a.config_status as configStatus ,
		a.config_step as configStep ,
		a.submit_status as submitStatus ,
		a.created_user as createdUser ,
		a.created_time as createdTime ,
		a.updated_user as updatedUser ,
		a.updated_time as updatedTime,
		case 
		when b.exec_level is null then '0000'
		else b.exec_level
		end as execLevel
		from
		st_project_cre a left join st_project_exec b on a.id=b.id
	</select>
</mapper>