From 6e8c95d31d85b53857e4e3ce12ea303eb0ea42eb Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 19 八月 2021 00:47:48 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 6d4313e..36a7091
--- a/java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/store/ContractServiceDaoImplMapper.xml
@@ -9,10 +9,12 @@
     <insert id="saveContractInfo" parameterType="Map">
         insert into contract(
         a_link,a_contacts,amount,contract_type,store_id,operator,signing_time,b_contacts,party_a,b_link,party_b,
-        contract_id,obj_id,contract_name,start_time,end_time,state,contract_code,obj_type,operator_link,contract_parent_id
+        contract_id,obj_id,contract_name,start_time,end_time,state,contract_code,obj_type,operator_link,contract_parent_id,
+        obj_name, obj_person_name, obj_person_id,start_user_id
         ) values (
         #{aLink},#{aContacts},#{amount},#{contractType},#{storeId},#{operator},#{signingTime},#{bContacts},#{partyA},#{bLink},#{partyB},
-        #{contractId},#{objId},#{contractName},#{startTime},#{endTime},#{state},#{contractCode},#{objType},#{operatorLink},#{contractParentId}
+        #{contractId},#{objId},#{contractName},#{startTime},#{endTime},#{state},#{contractCode},#{objType},#{operatorLink},#{contractParentId},
+        #{objName}, #{objPersonName}, #{objPersonId},#{startUserId}
         )
     </insert>
 
@@ -28,7 +30,8 @@
         endTime,t.state,t.contract_code,t.contract_code contractCode,t.obj_type,t.obj_type
         objType,t.operator_link,t.operator_link operatorLink,ct.type_name contractTypeName,td.`name`
         stateName,t.state_desc stateDesc,t.contract_parent_id contractParentId,tt.contract_code parentContractCode,
-        tt.contract_name parentContractName
+        tt.contract_name parentContractName,t.obj_name objName, t.obj_person_name objPersonName, t.obj_person_id objPersonId,
+        t.start_user_id startUserId
         from contract t
         LEFT JOIN contract_type ct on t.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id =
         t.store_id
@@ -74,11 +77,23 @@
         <if test="contractId !=null and contractId != ''">
             and t.contract_id= #{contractId}
         </if>
+        <if test="contractIds !=null">
+            and t.contract_id in
+            <foreach collection="contractIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
         </if>
+        <if test="objPersonId !=null and objPersonId != ''">
+            and t.obj_person_id= #{objPersonId}
+        </if>
         <if test="contractName !=null and contractName != ''">
             and t.contract_name= #{contractName}
+        </if>
+        <if test="contractNameLike !=null and contractNameLike != ''">
+            and t.contract_name like  concat('%',#{contractNameLike},'%')
         </if>
         <if test="startTime !=null">
             and t.start_time= #{startTime}
@@ -157,13 +172,22 @@
         <if test="objId !=null and objId != ''">
             , t.obj_id= #{objId}
         </if>
+        <if test="objName !=null and objName != ''">
+            , t.obj_name= #{objName}
+        </if>
+        <if test="objPersonId !=null and objPersonId != ''">
+            , t.obj_person_id= #{objPersonId}
+        </if>
+        <if test="objPersonName !=null and objPersonName != ''">
+            , t.obj_person_name= #{objPersonName}
+        </if>
         <if test="contractName !=null and contractName != ''">
             , t.contract_name= #{contractName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             , t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null">
             , t.end_time= #{endTime}
         </if>
         <if test="state !=null and state != ''">
@@ -235,6 +259,9 @@
         <if test="objId !=null and objId != ''">
             and t.obj_id= #{objId}
         </if>
+        <if test="objPersonId !=null and objPersonId != ''">
+            and t.obj_person_id= #{objPersonId}
+        </if>
         <if test="contractName !=null and contractName != ''">
             and t.contract_name= #{contractName}
         </if>

--
Gitblit v1.8.0