|
@@ -29,11 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="custodianId" column="custodian_id" />
|
|
|
<result property="custodianName" column="custodian_name" />
|
|
|
<result property="storageLocation" column="storage_location" />
|
|
|
+ <result property="issuingUnitName" column="issuing_unit_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTContractManagementVo">
|
|
|
select f_id, f_no, contract_no, create_by, create_time, update_by, update_time, remark, del_flag, f_status, content, copies, creation_date, file_type,
|
|
|
- submission_method, submitting_department_id, submitting_department_name, issuing_unit_id, archive_time, validity_month, storage_period_time,
|
|
|
+ submission_method, submitting_department_id, submitting_department_name, issuing_unit_id, issuing_unit_name, archive_time, validity_month, storage_period_time,
|
|
|
custodian_id, custodian_name, storage_location
|
|
|
from t_contract_management
|
|
|
</sql>
|
|
@@ -58,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="submittingDepartmentId != null "> and submitting_department_id = #{submittingDepartmentId}</if>
|
|
|
<if test="submittingDepartmentName != null and submittingDepartmentName != ''"> and submitting_department_name like concat('%', #{submittingDepartmentName}, '%')</if>
|
|
|
<if test="issuingUnitId != null "> and issuing_unit_id = #{issuingUnitId}</if>
|
|
|
+ <if test="issuingUnitName != null and issuingUnitName != ''"> and issuing_unit_name like concat('%', #{issuingUnitName}, '%')</if>
|
|
|
<if test='archiveTimeList != null and archiveTimeList[0] != null and archiveTimeList[0]!= ""'>
|
|
|
and archive_time >= #{archiveTimeList[0]}
|
|
|
</if>
|
|
@@ -104,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="custodianId != null">custodian_id,</if>
|
|
|
<if test="custodianName != null">custodian_name,</if>
|
|
|
<if test="storageLocation != null">storage_location,</if>
|
|
|
+ <if test="issuingUnitName != null">issuing_unit_name,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="fNo != null">#{fNo},</if>
|
|
@@ -129,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="custodianId != null">#{custodianId},</if>
|
|
|
<if test="custodianName != null">#{custodianName},</if>
|
|
|
<if test="storageLocation != null">#{storageLocation},</if>
|
|
|
+ <if test="issuingUnitName != null">#{issuingUnitName},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -158,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="custodianId != null">custodian_id = #{custodianId},</if>
|
|
|
<if test="custodianName != null">custodian_name = #{custodianName},</if>
|
|
|
<if test="storageLocation != null">storage_location = #{storageLocation},</if>
|
|
|
+ <if test="issuingUnitName != null">issuing_unit_name = #{issuingUnitName},</if>
|
|
|
</trim>
|
|
|
where f_id = #{fId}
|
|
|
</update>
|
|
@@ -175,5 +180,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{fId}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
+
|
|
|
+ <select id="selectContractList" parameterType="TContractManagement" resultMap="TContractManagementResult">
|
|
|
+ SELECT
|
|
|
+ TCM.f_id, TCM.f_no, TCM.contract_no, TCM.create_by, TCM.create_time, TCM.update_by, TCM.update_time, TCM.remark, TCM.del_flag, TCM.f_status,
|
|
|
+ TCM.content, TCM.copies, TCM.creation_date, TCM.file_type,TCM.submission_method, TCM.submitting_department_id, TCM.submitting_department_name,
|
|
|
+ TCM.issuing_unit_id, TCM.issuing_unit_name, TCM.archive_time,TCM.validity_month, TCM.storage_period_time,TCM.custodian_id, TCM.custodian_name,
|
|
|
+ TCM.storage_location, pro.dict_label AS fileTypeName, sd.dict_label AS submissionMethodName
|
|
|
+ FROM
|
|
|
+ t_contract_management TCM
|
|
|
+ LEFT JOIN sys_dict_data pro ON pro.dict_value = TCM.file_type
|
|
|
+ AND pro.dict_type = 'file_type'
|
|
|
+ LEFT JOIN sys_dict_data sd ON sd.dict_value = TCM.submission_method
|
|
|
+ AND sd.dict_type = 'submission_method'
|
|
|
+ <where>
|
|
|
+ del_flag = 0
|
|
|
+ <if test="fNo != null and fNo != ''"> and TCM.f_no like concat('%', #{fNo}, '%')</if>
|
|
|
+ <if test="contractNo != null and contractNo != ''"> and TCM.contract_no like concat('%', #{contractNo}, '%')</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''"> and TCM.f_status = #{fStatus}</if>
|
|
|
+ <if test="content != null and content != ''"> and TCM.content = #{content}</if>
|
|
|
+ <if test="copies != null "> and TCM.copies = #{copies}</if>
|
|
|
+ <if test='creationDateList != null and creationDateList[0] != null and creationDateList[0]!= ""'>
|
|
|
+ and TCM.creation_date >= #{creationDateList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='creationDateList != null and creationDateList[1] != null and creationDateList[1]!= ""'>
|
|
|
+ and TCM.creation_date <= #{creationDateList[1]}
|
|
|
+ </if>
|
|
|
+ <if test="fileType != null and fileType != ''"> and TCM.file_type = #{fileType}</if>
|
|
|
+ <if test="submissionMethod != null and submissionMethod != ''"> and TCM.submission_method = #{submissionMethod}</if>
|
|
|
+ <if test="submittingDepartmentId != null "> and TCM.submitting_department_id = #{submittingDepartmentId}</if>
|
|
|
+ <if test="submittingDepartmentName != null and submittingDepartmentName != ''"> and TCM.submitting_department_name like concat('%', #{submittingDepartmentName}, '%')</if>
|
|
|
+ <if test="issuingUnitId != null "> and TCM.issuing_unit_id = #{issuingUnitId}</if>
|
|
|
+ <if test="issuingUnitName != null and issuingUnitName != ''"> and TCM.issuing_unit_name like concat('%', #{issuingUnitName}, '%')</if>
|
|
|
+ <if test='archiveTimeList != null and archiveTimeList[0] != null and archiveTimeList[0]!= ""'>
|
|
|
+ and TCM.archive_time >= #{archiveTimeList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='archiveTimeList != null and archiveTimeList[1] != null and archiveTimeList[1]!= ""'>
|
|
|
+ and TCM.archive_time <= #{archiveTimeList[1]}
|
|
|
+ </if>
|
|
|
+ <if test="validityMonth != null "> and TCM.validity_month = #{validityMonth}</if>
|
|
|
+ <if test="storagePeriodTime != null "> and TCM.storage_period_time = #{storagePeriodTime}</if>
|
|
|
+ <if test="custodianId != null "> and TCM.custodian_id = #{custodianId}</if>
|
|
|
+ <if test="custodianName != null and custodianName != ''"> and TCM.custodian_name like concat('%', #{custodianName}, '%')</if>
|
|
|
+ <if test="storageLocation != null and storageLocation != ''"> and TCM.storage_location = #{storageLocation}</if>
|
|
|
+ </where>
|
|
|
+ order by TCM.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="checkContractNo" parameterType="TContractManagement" resultType="int">
|
|
|
+ select count(1) from t_contract_management
|
|
|
+ <where>
|
|
|
+ del_flag = 0
|
|
|
+ <if test="contractNo != null and contractNo != ''"> and contract_no = #{contractNo}</if>
|
|
|
+ <if test="fId != null and fId != ''"> and f_id != #{fId}</if>
|
|
|
+ </where>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|