|
@@ -50,7 +50,10 @@
|
|
|
a.project_type as "projectType",
|
|
|
a.over_due_status as "overDueStatus",
|
|
|
a.attachment_project_sort as "attachmentProjectSort",
|
|
|
- a.bzshb_user_id as "bzshbUserId"
|
|
|
+ a.bzshb_user_id as "bzshbUserId",
|
|
|
+ a.check_remarks as "check_Remarks",
|
|
|
+ a.file_num as "fileNum",
|
|
|
+ a.file_num_tow as "fileNumTow"
|
|
|
</sql>
|
|
|
|
|
|
<sql id="projectRecordsJoins">
|
|
@@ -280,6 +283,15 @@
|
|
|
check_process_instance_id = #{checkProcessInstanceId},
|
|
|
check_status = #{checkStatus},
|
|
|
check_user_id = #{checkUserId}
|
|
|
+ <if test="checkRemarks!=null and checkRemarks!=''">
|
|
|
+ ,check_remarks = #{checkRemarks}
|
|
|
+ </if>
|
|
|
+ <if test="fileNum!=null and fileNum!=''">
|
|
|
+ ,file_num = #{fileNum}
|
|
|
+ </if>
|
|
|
+ <if test="fileNumTow!=null and fileNumTow!=''">
|
|
|
+ ,file_num_tow = #{fileNumTow}
|
|
|
+ </if>
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
|
|
@@ -288,6 +300,15 @@
|
|
|
UPDATE rural_project_records SET
|
|
|
check_status = #{checkStatus},
|
|
|
check_process_instance_id = #{checkProcessInstanceId}
|
|
|
+ <if test="checkRemarks!=null and checkRemarks!=''">
|
|
|
+ ,check_remarks = #{checkRemarks}
|
|
|
+ </if>
|
|
|
+ <if test="fileNum!=null and fileNum!=''">
|
|
|
+ ,file_num = #{fileNum}
|
|
|
+ </if>
|
|
|
+ <if test="fileNumTow!=null and fileNumTow!=''">
|
|
|
+ ,file_num_tow = #{fileNumTow}
|
|
|
+ </if>
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
|
|
|
@@ -349,6 +370,15 @@
|
|
|
<if test="updateDate!=null">
|
|
|
update_date = #{updateDate}
|
|
|
</if>
|
|
|
+ <if test="checkRemarks!=null and checkRemarks!=''">
|
|
|
+ ,check_remarks = #{checkRemarks}
|
|
|
+ </if>
|
|
|
+ <if test="fileNum!=null and fileNum!=''">
|
|
|
+ ,file_num = #{fileNum}
|
|
|
+ </if>
|
|
|
+ <if test="fileNumTow!=null and fileNumTow!=''">
|
|
|
+ ,file_num_tow = #{fileNumTow}
|
|
|
+ </if>
|
|
|
</set>
|
|
|
WHERE id = #{id}
|
|
|
</update>
|
|
@@ -363,4 +393,595 @@
|
|
|
id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="getProjectByCheckProcessInstanceId" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,a.check_user_id as "checkUserId"
|
|
|
+ ,ifnull(a.check_status ,0) as "checkStatus"
|
|
|
+ ,a.check_process_instance_id AS "checkProcessInstanceId"
|
|
|
+ ,su.name AS "createBy.name"
|
|
|
+ ,o.top_company AS "office.name"
|
|
|
+ FROM rural_project_records a
|
|
|
+ <include refid="projectRecordsJoins"/>
|
|
|
+ LEFT JOIN sys_user su ON su.id = a.create_by
|
|
|
+ LEFT JOIN sys_office o ON o.id = a.office_id
|
|
|
+ WHERE a.check_process_instance_id = #{checkProcessInstanceId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findListByZg" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,a.check_user_id as "checkUserId"
|
|
|
+ ,ifnull(a.check_status ,0) as "checkStatus"
|
|
|
+ ,a.check_process_instance_id AS "checkProcessInstanceId"
|
|
|
+ ,wci.name AS "workContractInfo.name",
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
+ o.top_company AS "office.name"
|
|
|
+ FROM rural_project_records a
|
|
|
+ <include refid="projectRecordsJoins"/>
|
|
|
+
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_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 o ON o.id = a.office_id
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and a.bzshb_user_id = #{bzshbUserId}
|
|
|
+ </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.check_status,a.update_date desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryCountByZg" resultType="java.lang.Integer" >
|
|
|
+ SELECT count(DISTINCT a.id)
|
|
|
+ FROM rural_project_records a
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
+ <if test="workContractInfo !=null">
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and a.bzshb_user_id = #{bzshbUserId}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findListByXxgdy" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,a.check_user_id as "checkUserId"
|
|
|
+ ,ifnull(a.check_status ,0) as "checkStatus"
|
|
|
+ ,a.check_process_instance_id AS "checkProcessInstanceId"
|
|
|
+ ,wci.name AS "workContractInfo.name",
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
+ o.top_company AS "office.name"
|
|
|
+ FROM rural_project_records a
|
|
|
+ <include refid="projectRecordsJoins"/>
|
|
|
+
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_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 o ON o.id = a.office_id
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and (a.check_status is not null)
|
|
|
+ </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.check_status,a.update_date desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryCountByXxgdy" resultType="java.lang.Integer" >
|
|
|
+ SELECT count(DISTINCT a.id)
|
|
|
+ FROM rural_project_records a
|
|
|
+ <if test="leaderNameStr !=null and leaderNameStr !=''">
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
+ <if test="workContractInfo !=null">
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and (a.check_status is not null)
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findListByYg" resultType="RuralProjectRecords" >
|
|
|
+ SELECT
|
|
|
+ <include refid="projectRecordsColumns"/>
|
|
|
+ ,a.check_user_id as "checkUserId"
|
|
|
+ ,ifnull(a.check_status ,0) as "checkStatus"
|
|
|
+ ,a.check_process_instance_id AS "checkProcessInstanceId"
|
|
|
+ ,wci.name AS "workContractInfo.name",
|
|
|
+ wct.id AS "workContractInfo.client.id",
|
|
|
+ wct.name AS "workContractInfo.client.name",
|
|
|
+ o.top_company AS "office.name"
|
|
|
+ FROM rural_project_records a
|
|
|
+ <include refid="projectRecordsJoins"/>
|
|
|
+
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id and w.is_master=1
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_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 o ON o.id = a.office_id
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and a.check_status is not null and w.user_id = #{createBy.id}
|
|
|
+ </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.check_status,a.update_date desc
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryCountByYg" resultType="java.lang.Integer" >
|
|
|
+ SELECT count(DISTINCT a.id)
|
|
|
+ FROM rural_project_records a
|
|
|
+ LEFT JOIN work_project_user w on a.id = w.project_id and w.is_master=1
|
|
|
+ LEFT JOIN sys_user su on w.user_id = su.id
|
|
|
+ LEFT JOIN work_project_user w1 on a.id = w1.project_id
|
|
|
+ <if test="workContractInfo !=null">
|
|
|
+ LEFT JOIN work_contract_info wci on a.contract_id = wci.id
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo!=null and workContractInfo.client !=null and workContractInfo.client.name !=null and workContractInfo.client.name !=''">
|
|
|
+ LEFT JOIN work_client_info wct on wci.client_id = wct.id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and a.status = 5
|
|
|
+ <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="scaleType != null and scaleType != ''">
|
|
|
+ AND a.scale_type = #{scaleType}
|
|
|
+ </if>
|
|
|
+ <if test="scaleUnit != null and scaleUnit != ''">
|
|
|
+ AND a.scale_unit = #{scaleUnit}
|
|
|
+ </if>
|
|
|
+ <if test="scaleQuantity != null and scaleQuantity != ''">
|
|
|
+ AND a.scale_quantity = #{scaleQuantity}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.project_site LIKE concat('%',#{projectSite},'%')
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND a.remarks LIKE concat('%',#{remarks},'%')
|
|
|
+ </if>
|
|
|
+ <if test="projectDesc != null and projectDesc != ''">
|
|
|
+ AND a.project_desc LIKE concat('%',#{projectDesc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="area != null and area.id != null and area.id != ''">
|
|
|
+ AND a.area_id = #{area.id}
|
|
|
+ </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.contractNum !=null and workContractInfo.contractNum !=''">
|
|
|
+ AND wci.contract_num like concat(concat('%',#{workContractInfo.contractNum}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractPrice !=null and workContractInfo.contractPrice !=''">
|
|
|
+ AND wci.contract_price = #{workContractInfo.contractPrice}
|
|
|
+ </if>
|
|
|
+ <if test="workContractInfo !=null and workContractInfo.contractType !=null and workContractInfo.contractType !=''">
|
|
|
+ AND wci.contract_type = #{workContractInfo.contractType}
|
|
|
+ </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}),'%') AND w.is_master = '1' AND w.del_flag='0'
|
|
|
+ </if>
|
|
|
+ <if test="checkStatus !=null">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus == 0">
|
|
|
+ AND a.check_status is null
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.check_status = #{checkStatus}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="beginDate !=null">
|
|
|
+ AND a.create_date >= #{beginDate}
|
|
|
+ </if>
|
|
|
+ <if test="endDate !=null">
|
|
|
+ AND a.create_date < #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test="typeList !=null and typeList !=''">
|
|
|
+ and project_type in
|
|
|
+ <foreach collection="typeList" item="id" index="index" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and a.check_status is not null and w.user_id = #{createBy.id}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|