|
@@ -733,4 +733,106 @@
|
|
|
order by a.update_date desc,a.name
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findInfoByStatus" resultType="ProjectReportData" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectReportDataColumns"/>,
|
|
|
+ wci.contract_num AS "contractNum",
|
|
|
+ wci.name AS "contractName",
|
|
|
+ wct.name AS "clientName",
|
|
|
+ o.name AS "officeName",
|
|
|
+ uo.name AS "signCostOne.name",
|
|
|
+ ut.name AS "signCostTwo.name",
|
|
|
+ r.project_name AS "project.projectName",
|
|
|
+ r.project_id AS "project.projectId"
|
|
|
+ FROM project_report_data a
|
|
|
+ <include refid="projectReportDataJoins"/>
|
|
|
+ LEFT JOIN sys_office o ON o.id = a.office_id
|
|
|
+ LEFT JOIN sys_user uo ON uo.id = a.sign_cost_one
|
|
|
+ LEFT JOIN sys_user ut ON ut.id = a.sign_cost_two
|
|
|
+ LEFT JOIN project_records r ON r.id = a.project_id
|
|
|
+ LEFT JOIN work_contract_info wci on r.contract_id = wci.id
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="project != null and project.id != null and project.id != ''">
|
|
|
+ AND a.project_id = #{project.id}
|
|
|
+ </if>
|
|
|
+ <if test="type != null and type != ''">
|
|
|
+ AND a.type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ AND a.name like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="number != null and number != ''">
|
|
|
+ AND a.number like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">CONCAT('%', #{number}, '%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="achievementType != null and achievementType != ''">
|
|
|
+ AND a.achievement_type = #{achievementType}
|
|
|
+ </if>
|
|
|
+ <if test="signCostOne!=null and signCostOne.id != null and signCostOne.id != ''">
|
|
|
+ AND a.sign_cost_one = #{signCostOne.id}
|
|
|
+ </if>
|
|
|
+ <if test="signCostTwo!=null and signCostTwo.id != null and signCostTwo.id != ''">
|
|
|
+ AND a.sign_cost_two = #{signCostTwo.id}
|
|
|
+ </if>
|
|
|
+ <if test="master!=null and master.id != null and master.id != ''">
|
|
|
+ AND a.master = #{master.id}
|
|
|
+ </if>
|
|
|
+ <if test="reviewStandard != null and reviewStandard != ''">
|
|
|
+ AND a.review_standard = #{reviewStandard}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ AND a.report_date >= #{startDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ AND a.report_date <= #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="fileStatus != null and fileStatus != ''">
|
|
|
+ AND a.file_status = #{fileStatus}
|
|
|
+ </if>
|
|
|
+ <if test="officeId != null and officeId != ''">
|
|
|
+ AND a.office_id = #{officeId}
|
|
|
+ </if>
|
|
|
+ <if test="createStartDate != null and createStartDate != ''">
|
|
|
+ AND a.create_date >= #{createStartDate}
|
|
|
+ </if>
|
|
|
+ <if test="createEndDate != null and createEndDate != ''">
|
|
|
+ AND a.create_date <= #{createEndDate}
|
|
|
+ </if>
|
|
|
+ <if test="project!=null and project.projectName != null and project.projectName != ''">
|
|
|
+ AND r.project_name like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">CONCAT('%', #{project.projectName}, '%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="contractNum != null and contractNum != ''">
|
|
|
+ AND wci.contract_num like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{contractNum}||'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">CONCAT('%', #{contractNum}, '%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="clientName != null and clientName != ''">
|
|
|
+ AND wct.name like
|
|
|
+ <if test="dbName == 'oracle'">'%'||#{clientName}||'%'</if>
|
|
|
+ <if test="dbName == 'mysql'">CONCAT('%', #{clientName}, '%')</if>
|
|
|
+ </if>
|
|
|
+ <if test="projectMasterId != null and projectMasterId != ''">
|
|
|
+ AND #{projectMasterId} in (select user_id from work_project_user pm WHERE pm.project_id = a.project_id AND is_master = '1' AND pm.del_flag = '0')
|
|
|
+ </if>
|
|
|
+ AND a.status in ('5','7')
|
|
|
+ and a. id =#{id}
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|