<?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.modules.projectcontentinfo.dao.ProjectReportDataInfoDao">

	<select id="findList" resultType="ProjectReportDataInfo" >
		SELECT
		a.id AS "id",
		a.name AS "name",
		a.number AS "number",
		a.type AS "type",
		a.achievement_type AS "achievementType",
		a.sign_cost_one AS "signCostOne.id",
		a.sign_cost_two AS "signCostTwo.id",
		a.master AS "master.id",
		a.report_date AS "reportDate",
		m.name AS "master.name",
		o.name AS "sign_cost_one.name",
		t.name AS "sign_cost_two.name"
		FROM project_report_data a
		LEFT JOIN sys_user o ON o.id = a.sign_cost_one
		LEFT JOIN sys_user t ON t.id = a.sign_cost_two
		LEFT JOIN sys_user m ON m.id = a.master
		where a.del_flag = '0' and a.office_id = #{officeId} and a.status = '5'
		<if test="date!=null and date !=''">
			AND YEAR(a.report_date) = #{date}
		</if>
		<if test="officeId != null and officeId != ''">
			AND a.office_id = #{officeId}
		</if>
		order by a.create_date DESC
	</select>

</mapper>