|
@@ -111,7 +111,9 @@
|
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteContractRelationJLYZ">
|
|
|
- delete from m_contract_relation_jlyz where contract_id_jlyz = #{id}
|
|
|
+ delete
|
|
|
+ from m_contract_relation_jlyz
|
|
|
+ where contract_id_jlyz = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<select id="selectContractByProjectIds" resultMap="contractInfoResultMap">
|
|
@@ -388,7 +390,12 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectContractIdByProjectId" resultType="org.springblade.manager.entity.ContractInfo">
|
|
|
- SELECT id FROM m_contract_info WHERE p_id = #{project_id} AND contract_type = 1 AND is_deleted = 0 AND status = 1
|
|
|
+ SELECT id
|
|
|
+ FROM m_contract_info
|
|
|
+ WHERE p_id = #{project_id}
|
|
|
+ AND contract_type = 1
|
|
|
+ AND is_deleted = 0
|
|
|
+ AND status = 1
|
|
|
</select>
|
|
|
|
|
|
<select id="tree4" resultType="org.springblade.manager.vo.WbsTreeContractVO">
|
|
@@ -411,7 +418,11 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectContractUserInfo" resultType="org.springblade.manager.entity.SaveUserInfoByProject">
|
|
|
- select * from m_project_assignment_user where contract_id = #{contractId} and is_deleted = 0 and status = 1
|
|
|
+ select *
|
|
|
+ from m_project_assignment_user
|
|
|
+ where contract_id = #{contractId}
|
|
|
+ and is_deleted = 0
|
|
|
+ and status = 1
|
|
|
</select>
|
|
|
|
|
|
<select id="userListByIds" resultType="org.springblade.system.user.vo.UserContractInfoVO">
|
|
@@ -422,25 +433,23 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="tree5" resultType="org.springblade.manager.vo.WbsTreeContractTreeAllVO">
|
|
|
- SELECT
|
|
|
- d.p_key_id AS "primaryKeyId",
|
|
|
- d.id,
|
|
|
- d.parent_id AS "parentId",
|
|
|
- IFNULL(if(length(trim(full_name)) > 0, full_name, node_name),node_name) AS title,
|
|
|
- partition_code,
|
|
|
- node_type,
|
|
|
- sort,
|
|
|
- d.contract_id AS contractIdRelation,
|
|
|
- d.type,
|
|
|
- d.major_data_type AS majorDataType,
|
|
|
- d.create_time
|
|
|
+ SELECT d.p_key_id AS "primaryKeyId",
|
|
|
+ d.id,
|
|
|
+ d.parent_id AS "parentId",
|
|
|
+ IFNULL(if(length(trim(full_name)) > 0, full_name, node_name), node_name) AS title,
|
|
|
+ partition_code,
|
|
|
+ node_type,
|
|
|
+ sort,
|
|
|
+ d.contract_id AS contractIdRelation,
|
|
|
+ d.type,
|
|
|
+ d.major_data_type AS majorDataType,
|
|
|
+ d.create_time
|
|
|
FROM m_wbs_tree_contract d
|
|
|
- WHERE
|
|
|
- contract_id = #{contractId}
|
|
|
- AND d.type = 1
|
|
|
- AND d.status = 1
|
|
|
- AND d.is_deleted = 0
|
|
|
- ORDER BY d.sort,title,d.create_time
|
|
|
+ WHERE contract_id = #{contractId}
|
|
|
+ AND d.type = 1
|
|
|
+ AND d.status = 1
|
|
|
+ AND d.is_deleted = 0
|
|
|
+ ORDER BY d.sort, title, d.create_time
|
|
|
</select>
|
|
|
|
|
|
<select id="tree6" resultMap="treeNodeResultMap6">
|
|
@@ -473,21 +482,44 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="trialRelationTree" resultType="org.springblade.manager.vo.TrialRecordZJTreeVO">
|
|
|
- SELECT
|
|
|
- d.p_key_id AS "primaryKeyId",
|
|
|
- d.id AS id,
|
|
|
- IFNULL(if(length(trim(d.full_name)) > 0, d.full_name, d.node_name),d.node_name) AS fullName,
|
|
|
- d.parent_id AS "parentId"
|
|
|
+ SELECT d.p_key_id AS "primaryKeyId",
|
|
|
+ d.id AS id,
|
|
|
+ IFNULL(if(length(trim(d.full_name)) > 0, d.full_name, d.node_name), d.node_name) AS fullName,
|
|
|
+ d.parent_id AS "parentId"
|
|
|
FROM m_wbs_tree_contract d
|
|
|
- WHERE
|
|
|
- d.is_deleted = 0
|
|
|
- AND d.status = 1
|
|
|
- AND d.type = 1
|
|
|
- AND wbs_type = 1
|
|
|
- AND project_id = #{projectId}
|
|
|
- AND contract_id = #{contractId}
|
|
|
- AND wbs_id = #{wbsId}
|
|
|
- ORDER BY d.sort,d.create_time
|
|
|
+ WHERE d.is_deleted = 0
|
|
|
+ AND d.status = 1
|
|
|
+ AND d.type = 1
|
|
|
+ AND wbs_type = 1
|
|
|
+ AND project_id = #{projectId}
|
|
|
+ AND contract_id = #{contractId}
|
|
|
+ AND wbs_id = #{wbsId}
|
|
|
+ ORDER BY d.sort, d.create_time
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="trialRelationTreeLazy" resultType="org.springblade.manager.vo.TrialRecordZJTreeLazyVO">
|
|
|
+ SELECT d.p_key_id AS "primaryKeyId",
|
|
|
+ d.id AS id,
|
|
|
+ IFNULL(if(length(trim(d.full_name)) > 0, d.full_name, d.node_name), d.node_name) AS fullName,
|
|
|
+ d.parent_id AS "parentId",
|
|
|
+ (select case when count(1) > 0 then 1 else 0 end
|
|
|
+ from m_wbs_tree_contract
|
|
|
+ where parent_id = d.id
|
|
|
+ and is_deleted = 0
|
|
|
+ and project_id = #{projectId}
|
|
|
+ and contract_id = #{contractId}
|
|
|
+ and wbs_id = #{wbsId}) AS "status"
|
|
|
+ FROM m_wbs_tree_contract d
|
|
|
+ WHERE d.is_deleted = 0
|
|
|
+ AND d.status = 1
|
|
|
+ AND d.type = 1
|
|
|
+ AND wbs_type = 1
|
|
|
+ AND project_id = #{projectId}
|
|
|
+ AND contract_id = #{contractId}
|
|
|
+ AND wbs_id = #{wbsId}
|
|
|
+ AND parent_id = #{id}
|
|
|
+ AND node_type in (1, 2, 3, 4, 5, 6)
|
|
|
+ ORDER BY d.sort, d.create_time
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|