<?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.jeeplus.assess.proofread.mapper.ProofreadInfoMapper">

	<select id="findByProjectId" resultType="com.jeeplus.assess.proofread.service.dto.ProofreadInfoDto">
		SELECT
			a.id,
			a.create_by_id,
			a.create_time,
			a.update_by_id,
			a.update_time,
			a.del_flag,
			a.type,
			a.project_id,
			b.`name` AS project_name,
			b.assessment_date,
			d.`name` AS project_manager_name,
			a.process_user_id,
			c.name AS process_user_name,
			a.process_date,
			a.reservations,
			a.unmodified_comments
		FROM proofread_info a
		LEFT JOIN program_project_list_info b ON a.project_id = b.id
		LEFT JOIN sys_user c ON a.process_user_id = c.id
		LEFT JOIN sys_user d ON b.project_manager = d.id
		WHERE
			a.del_flag = 0
			AND a.project_id = #{id}
			AND a.type = #{type}
	</select>

</mapper>
