| | |
| | | partyB,t.contract_id,t.contract_id contractId,t.obj_id,t.obj_id objId,t.contract_name,t.contract_name |
| | | contractName,t.start_time,t.start_time startTime,t.end_time,t.end_time |
| | | 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` |
| | | objType,t.operator_link,t.operator_link operatorLink,ct.type_name contractTypeName,ct.audit,td.`name` |
| | | stateName,t.state_desc stateDesc,t.contract_parent_id contractParentId,tt.contract_code parentContractCode, |
| | | tt.contract_name parentContractName,t.obj_name objName, t.obj_person_name objPersonName, t.obj_person_id objPersonId, |
| | | t.start_user_id startUserId |
| | | t.start_user_id startUserId,t.create_time createTime |
| | | 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 |
| | |
| | | <if test="partyB !=null and partyB != ''"> |
| | | and t.party_b= #{partyB} |
| | | </if> |
| | | <if test="partyBLike !=null and partyBLike != ''"> |
| | | and t.party_b like concat('%',#{partyBLike},'%') |
| | | </if> |
| | | <if test="contractId !=null and contractId != ''"> |
| | | and t.contract_id= #{contractId} |
| | | </if> |
| | |
| | | <if test="endTime !=null "> |
| | | and t.end_time <= #{endTime} |
| | | </if> |
| | | <if test="queryStartTime !=null and queryStartTime != ''"> |
| | | and t.create_time > #{queryStartTime} |
| | | </if> |
| | | <if test="queryEndTime !=null and queryEndTime != ''"> |
| | | and t.create_time < #{queryEndTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | |
| | | <if test="contractCode !=null and contractCode != ''"> |
| | | and t.contract_code= #{contractCode} |
| | | </if> |
| | | <if test="contractCodeLike !=null and contractCodeLike != ''"> |
| | | and t.contract_code like concat('%',#{contractCodeLike},'%') |
| | | </if> |
| | | <if test="objType !=null and objType != ''"> |
| | | and t.obj_type= #{objType} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="contractParentId !=null and contractParentId != ''"> |
| | | and t.contract_parent_id= #{contractParentId} |
| | | </if> |
| | | <if test="parentContractCodeLike !=null and parentContractCodeLike != ''"> |
| | | and tt.contract_code like concat('%',#{parentContractCodeLike},'%') |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | |
| | | <select id="queryContractsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from contract t |
| | | left join contract tt on t.contract_parent_id = tt.contract_id and tt.status_cd = '0' and tt.store_id = t.store_id |
| | | where 1 =1 |
| | | <if test="aLink !=null and aLink != ''"> |
| | | and t.a_link= #{aLink} |
| | |
| | | <if test="partyB !=null and partyB != ''"> |
| | | and t.party_b= #{partyB} |
| | | </if> |
| | | <if test="partyBLike !=null and partyBLike != ''"> |
| | | and t.party_b like concat('%',#{partyBLike},'%') |
| | | </if> |
| | | <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 test="contractName !=null and contractName != ''"> |
| | | and t.contract_name= #{contractName} |
| | | </if> |
| | | <if test="startTime !=null "> |
| | | <if test="contractNameLike !=null and contractNameLike != ''"> |
| | | and t.contract_name like concat('%',#{contractNameLike},'%') |
| | | </if> |
| | | |
| | | |
| | | <if test="startTime !=null"> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null "> |
| | | and t.end_time <= #{endTime} |
| | | </if> |
| | | <if test="queryStartTime !=null and queryStartTime != ''"> |
| | | and t.create_time > #{queryStartTime} |
| | | </if> |
| | | <if test="queryEndTime !=null and queryEndTime != ''"> |
| | | and t.create_time < #{queryEndTime} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | |
| | | <if test="contractCode !=null and contractCode != ''"> |
| | | and t.contract_code= #{contractCode} |
| | | </if> |
| | | <if test="contractCodeLike !=null and contractCodeLike != ''"> |
| | | and t.contract_code like concat('%',#{contractCodeLike},'%') |
| | | </if> |
| | | <if test="objType !=null and objType != ''"> |
| | | and t.obj_type= #{objType} |
| | | </if> |
| | |
| | | <if test="contractParentId !=null and contractParentId != ''"> |
| | | and t.contract_parent_id= #{contractParentId} |
| | | </if> |
| | | <if test="parentContractCodeLike !=null and parentContractCodeLike != ''"> |
| | | and tt.contract_code like concat('%',#{parentContractCodeLike},'%') |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="queryContractsByOwnerIds" parameterType="Map" resultType="Map"> |
| | | select t.obj_id ownerId,count(t.contract_id) contractCount |
| | | from contract t |
| | | where t.status_cd = '0' |
| | | and t.obj_id in |
| | | <foreach collection="ownerIds" item="item" index="index" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | group by t.obj_id |
| | | </select> |
| | | |
| | | </mapper> |