|
@@ -1070,4 +1070,93 @@
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="processFindListByStatus" resultType="ProjectRecords" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
|
+ ,
|
|
|
|
+ wci.name AS "workContractInfo.name",
|
|
|
|
+ wci.contract_num AS "workContractInfo.contractNum",
|
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
|
+ o.top_company AS "office.name"
|
|
|
|
+ FROM project_records a
|
|
|
|
+ <include refid="projectRecordsJoins"/>
|
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
|
+ LEFT JOIN sys_user u on a.create_by = u.id
|
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
|
+ LEFT JOIN sys_office s ON s.id = a.company_id
|
|
|
|
+ LEFT JOIN sys_office o ON o.id = a.office_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
|
+ AND a.project_id like concat('%',#{projectId},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
|
+ AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
|
|
|
|
+ AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
|
+ AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
|
+ AND su.name like concat(concat('%',#{leaderNameStr}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ AND w.is_master = '1' AND a.status = '5' AND a.del_flag='0'
|
|
|
|
+ <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
|
+ AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND (s.id = #{currentUser.company.id} or find_in_set( #{currentUser.company.id}, s.parent_ids ) ))${sqlMap.dsf} )
|
|
|
|
+ </if>
|
|
|
|
+ AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
+ </where>
|
|
|
|
+ GROUP BY a.id
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="processQueryCountByStatus" resultType="int" >
|
|
|
|
+ SELECT count(DISTINCT a.id)
|
|
|
|
+ FROM project_records a
|
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
|
+ LEFT JOIN sys_user u on a.create_by = u.id
|
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
|
+ LEFT JOIN sys_office s ON s.id = a.company_id
|
|
|
|
+ LEFT JOIN sys_office o ON o.id = a.office_id
|
|
|
|
+ <where>
|
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
|
+ AND a.project_id like concat('%',#{projectId},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
|
+ AND a.project_name like concat(concat('%',#{projectName}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.name !=null and workContractInfo.name !=''">
|
|
|
|
+ AND wci.name like concat(concat('%',#{workContractInfo.name}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
|
+ AND wct.name like concat(concat('%',#{workContractInfo.client.name}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
|
+ AND su.name like concat(concat('%',#{leaderNameStr}),'%')
|
|
|
|
+ </if>
|
|
|
|
+ AND w.is_master = '1' AND a.status = '5' AND a.del_flag='0'
|
|
|
|
+ <if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
|
|
|
|
+ AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND (s.id = #{currentUser.company.id} or find_in_set( #{currentUser.company.id}, s.parent_ids ) ))${sqlMap.dsf} )
|
|
|
|
+ </if>
|
|
|
|
+ AND a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|