|
@@ -46,8 +46,88 @@
|
|
<result column="evaluate" property="evaluate"/>
|
|
<result column="evaluate" property="evaluate"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+ <resultMap id="queryContractTreeMap" type="org.springblade.manager.vo.WbsTreeContractTreeVOS">
|
|
|
|
+ <result column="primaryKeyId" property="primaryKeyId"/>
|
|
|
|
+ <result column="id" property="id"/>
|
|
|
|
+ <result column="title" property="title"/>
|
|
|
|
+ <result column="parentId" property="parentId"/>
|
|
|
|
+ <result column="contractId" property="contractId"/>
|
|
|
|
+ <result column="oldId" property="oldId"/>
|
|
|
|
+ <result column="majorDataType" property="majorDataType"/>
|
|
|
|
+ <result column="leaf" property="leaf"/>
|
|
|
|
+ <result column="notExsitChild" property="notExsitChild"/>
|
|
|
|
+ <result column="fileUrl" property="fileUrl"/>
|
|
|
|
+ <result column="drawingsId" property="drawingsId"/>
|
|
|
|
+ <result column="isFirst" property="isFirst"/>
|
|
|
|
+ <result column="deptCategory" property="deptCategory"/>
|
|
|
|
+ <result column="colorStatus" property="colorStatus"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
<resultMap id="intResultMap" type="java.lang.Integer"/>
|
|
<resultMap id="intResultMap" type="java.lang.Integer"/>
|
|
|
|
|
|
|
|
+ <select id="queryContractTree" resultMap="queryContractTreeMap">
|
|
|
|
+ SELECT
|
|
|
|
+ wtc.p_key_id AS primaryKeyId,
|
|
|
|
+ wtc.id,
|
|
|
|
+ IFNULL(if(length(trim(wtc.full_name)) > 0, wtc.full_name, wtc.dept_name),wtc.dept_name) AS title,
|
|
|
|
+ wtc.parent_id AS parentId,
|
|
|
|
+ wtc.contract_id AS contractId,
|
|
|
|
+ wtc.old_id AS oldId,
|
|
|
|
+ wtc.major_data_type AS majorDataType,
|
|
|
|
+ wtc.dept_category AS deptCategory,
|
|
|
|
+ CASE
|
|
|
|
+ wtc.dept_category
|
|
|
|
+ WHEN 6 THEN 'true'
|
|
|
|
+ ELSE 'false' END AS leaf,
|
|
|
|
+ CASE
|
|
|
|
+ (select count(tc.p_key_id) from m_wbs_tree_contract AS tc where tc.parent_id = wtc.id and tc.contract_id = #{contractId} and tc.type = 1 and tc.is_deleted = 0)
|
|
|
|
+ WHEN 0 THEN 'true'
|
|
|
|
+ ELSE 'false' END AS notExsitChild,
|
|
|
|
+ ctd.file_url AS fileUrl,
|
|
|
|
+ ctd.id AS drawingsId,
|
|
|
|
+ CASE
|
|
|
|
+ (select count(tcf.id) from u_tree_contract_first AS tcf where tcf.is_deleted = 0 and tcf.wbs_node_id = wtc.p_key_id)
|
|
|
|
+ WHEN 0 THEN 'false'
|
|
|
|
+ ELSE 'true' END AS isFirst,
|
|
|
|
+ querys.nodeStatus AS colorStatus
|
|
|
|
+ FROM
|
|
|
|
+ m_wbs_tree_contract AS wtc
|
|
|
|
+ LEFT JOIN u_contract_tree_drawings AS ctd ON ctd.is_deleted = 0 and ctd.process_id = wtc.p_key_id
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ SELECT
|
|
|
|
+ #{parentId} AS parentId,
|
|
|
|
+ CASE
|
|
|
|
+ WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus NOT LIKE CONCAT('%',2,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',3,'%') AND querys.nodeStatus NOT LIKE CONCAT('%',4,'%')) THEN 1
|
|
|
|
+ WHEN querys.nodeStatus LIKE CONCAT('%',1,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%') OR querys.nodeStatus LIKE CONCAT('%',4,'%')) THEN 2
|
|
|
|
+ WHEN querys.nodeStatus NOT LIKE CONCAT('%',1,'%') AND querys.nodeStatus LIKE CONCAT('%',4,'%') AND (querys.nodeStatus LIKE CONCAT('%',2,'%') OR querys.nodeStatus LIKE CONCAT('%',3,'%')) THEN 4
|
|
|
|
+ ELSE 2 END AS nodeStatus
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ group_concat(
|
|
|
|
+ CASE
|
|
|
|
+ WHEN iq.status is null THEN 1
|
|
|
|
+ WHEN iq.status = 1 THEN 3
|
|
|
|
+ WHEN iq.status = 2 THEN 4
|
|
|
|
+ ELSE 2 END
|
|
|
|
+ ) AS nodeStatus
|
|
|
|
+ FROM
|
|
|
|
+ m_wbs_tree_contract AS tc
|
|
|
|
+ LEFT JOIN u_information_query AS iq ON tc.p_key_id = iq.wbs_id
|
|
|
|
+ WHERE
|
|
|
|
+ tc.major_data_type in(1,2,3,4)
|
|
|
|
+ AND tc.ancestors LIKE concat('%', #{parentId}, '%')
|
|
|
|
+ AND tc.contract_id = #{contractId}
|
|
|
|
+ ) AS querys
|
|
|
|
+ ) AS querys ON wtc.parent_id = querys.parentId
|
|
|
|
+ WHERE
|
|
|
|
+ wtc.contract_id = #{contractId}
|
|
|
|
+ AND wtc.type = #{classify}
|
|
|
|
+ AND wtc.parent_id = #{parentId}
|
|
|
|
+ AND wtc.is_deleted= '0'
|
|
|
|
+ ORDER BY wtc.sort ASC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="queryProcessDataByPrimaryKeyIdAndClassify" resultMap="queryProcessDataMap">
|
|
<select id="queryProcessDataByPrimaryKeyIdAndClassify" resultMap="queryProcessDataMap">
|
|
SELECT
|
|
SELECT
|
|
wtc.id AS treeId,
|
|
wtc.id AS treeId,
|
|
@@ -124,7 +204,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getReportNumberByContractId" resultMap="intResultMap">
|
|
<select id="getReportNumberByContractId" resultMap="intResultMap">
|
|
- select report_number from u_information_query where is_deleted = 0 and contract_id = #{contractId} and classify = #{classify} group by report_number order by report_number ASC
|
|
|
|
|
|
+ select report_number from u_information_query where is_deleted = 0 and contract_id = #{contractId} and classify = #{classify} and report_number is not null group by report_number order by report_number ASC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryFileUserByContractId" resultMap="informationQueryResultMap">
|
|
<select id="queryFileUserByContractId" resultMap="informationQueryResultMap">
|