|
@@ -1677,5 +1677,140 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="getTCostManagementExportDetail" resultType="com.ruoyi.anpin.domain.CostManagementDetailExcel">
|
|
|
+ SELECT DISTINCT
|
|
|
+ TCM.f_no AS fNo,
|
|
|
+ TCM.print_time AS printTime,
|
|
|
+ TCM.print_date AS printDate,
|
|
|
+ CASE
|
|
|
+ WHEN TCM.f_status = '0' THEN
|
|
|
+ '录入'
|
|
|
+ WHEN TCM.f_status = '1' THEN
|
|
|
+ '请核'
|
|
|
+ WHEN TCM.f_status = '2' THEN
|
|
|
+ '审批中'
|
|
|
+ WHEN TCM.f_status = '3' THEN
|
|
|
+ '审批通过'
|
|
|
+ WHEN TCM.f_status = '4' THEN
|
|
|
+ '完成'
|
|
|
+ END AS fStatusName,
|
|
|
+ TCM.dept_name AS deptName,
|
|
|
+ TCM.create_by AS createBy,
|
|
|
+ TCM.create_dept_name AS createDeptName,
|
|
|
+ TCM.business_time AS businessTime,
|
|
|
+ TCM.create_time AS createTime,
|
|
|
+ TCM.total_amount AS totalAmount,
|
|
|
+ TCM.remark,
|
|
|
+ TCM.applicant_name AS applicantName,
|
|
|
+ TCM.f_review_date AS fReviewDate,
|
|
|
+ TCM.business_type AS businessType,
|
|
|
+ TCM.expense_type AS expenseType,
|
|
|
+ TCMI.expense_name AS expenseName,
|
|
|
+ TCMI.amount,
|
|
|
+ TCMI.belongs_project_name AS belongsProjectName,
|
|
|
+ TCMI.personnel_name AS personnelName,
|
|
|
+ TCMI.department_name AS departmentName,
|
|
|
+ TCMI.matter_name AS matterName,
|
|
|
+ TCMI.remark AS remarkDetail
|
|
|
+ FROM
|
|
|
+ t_cost_management TCM
|
|
|
+ LEFT JOIN t_cost_management_item TCMI ON TCMI.f_pid = TCM.f_id
|
|
|
+ <where>
|
|
|
+ TCM.del_flag = 0
|
|
|
+ <if test="deptId != null and deptId != ''">and TCM.dept_id = #{deptId}</if>
|
|
|
+ <if test="deptName != null and deptName != ''">and TCM.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
+ <if test='businessTimeList != null and businessTimeList[0] != null and businessTimeList[0]!= ""'>
|
|
|
+ and TCM.business_time >= #{businessTimeList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='businessTimeList != null and businessTimeList[1] != null and businessTimeList[1]!= ""'>
|
|
|
+ and TCM.business_time <= #{businessTimeList[1]}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="businessType != null and businessType != ''">and TCM.business_type = #{businessType}</if>
|
|
|
+ <if test="expenseType != null and expenseType != ''">and TCM.expense_type = #{expenseType}</if>
|
|
|
+
|
|
|
+ <if test="createDept != null and createDept != ''">and TCM.create_dept = #{createDept}</if>
|
|
|
+ <if test="createDeptName != null and createDeptName != ''">and TCM.create_dept_name like concat('%',
|
|
|
+ #{createDeptName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="createById != null and createById != ''">and TCM.create_by_id = #{createById}</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and TCM.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
+ <if test="itemExpenseId != null and itemExpenseId != ''">and TCMI.expense_id = #{itemExpenseId}</if>
|
|
|
+ <if test="itemBelongsProjectId != null and itemBelongsProjectId != ''">and TCMI.belongs_project_id =
|
|
|
+ #{itemBelongsProjectId}
|
|
|
+ </if>
|
|
|
+ <if test="itemDepartment != null and itemDepartment != ''">and TCMI.department_id = #{itemDepartment}</if>
|
|
|
+ <if test="itemPersonnel != null and itemPersonnel != ''">and TCMI.personnel_id = #{itemPersonnel}</if>
|
|
|
+ <if test="itemMatterName != null and itemMatterName != ''">and TCMI.matter_name like concat('%',
|
|
|
+ #{itemMatterName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">and TCM.remark like concat('%', #{remark}, '%')</if>
|
|
|
+ </where>
|
|
|
+ order by TCM.create_time desc
|
|
|
+ </select>
|
|
|
+ <select id="getTCostManagementExportAll" resultType="com.ruoyi.anpin.domain.CostManagementExcel">
|
|
|
+ SELECT DISTINCT
|
|
|
+ TCM.f_no AS fNo,
|
|
|
+ TCM.print_time AS printTime,
|
|
|
+ TCM.print_date AS printDate,
|
|
|
+ CASE
|
|
|
+ WHEN TCM.f_status = '0' THEN
|
|
|
+ '录入'
|
|
|
+ WHEN TCM.f_status = '1' THEN
|
|
|
+ '请核'
|
|
|
+ WHEN TCM.f_status = '2' THEN
|
|
|
+ '审批中'
|
|
|
+ WHEN TCM.f_status = '3' THEN
|
|
|
+ '审批通过'
|
|
|
+ WHEN TCM.f_status = '4' THEN
|
|
|
+ '完成'
|
|
|
+ END AS fStatusName,
|
|
|
+ TCM.dept_name AS deptName,
|
|
|
+ TCM.create_by AS createBy,
|
|
|
+ TCM.create_dept_name AS createDeptName,
|
|
|
+ TCM.business_time AS businessTime,
|
|
|
+ TCM.create_time AS createTime,
|
|
|
+ TCM.total_amount AS totalAmount,
|
|
|
+ TCM.remark,
|
|
|
+ TCM.applicant_name AS applicantName,
|
|
|
+ TCM.f_review_date AS fReviewDate,
|
|
|
+ TCM.business_type AS businessType,
|
|
|
+ TCM.expense_type AS expenseType
|
|
|
+ FROM
|
|
|
+ t_cost_management TCM
|
|
|
+ LEFT JOIN t_cost_management_item TCMI ON TCMI.f_pid = TCM.f_id
|
|
|
+ <where>
|
|
|
+ TCM.del_flag = 0
|
|
|
+ <if test="deptId != null and deptId != ''">and TCM.dept_id = #{deptId}</if>
|
|
|
+ <if test="deptName != null and deptName != ''">and TCM.dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
+ <if test='businessTimeList != null and businessTimeList[0] != null and businessTimeList[0]!= ""'>
|
|
|
+ and TCM.business_time >= #{businessTimeList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='businessTimeList != null and businessTimeList[1] != null and businessTimeList[1]!= ""'>
|
|
|
+ and TCM.business_time <= #{businessTimeList[1]}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="businessType != null and businessType != ''">and TCM.business_type = #{businessType}</if>
|
|
|
+ <if test="expenseType != null and expenseType != ''">and TCM.expense_type = #{expenseType}</if>
|
|
|
+
|
|
|
+ <if test="createDept != null and createDept != ''">and TCM.create_dept = #{createDept}</if>
|
|
|
+ <if test="createDeptName != null and createDeptName != ''">and TCM.create_dept_name like concat('%',
|
|
|
+ #{createDeptName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="createById != null and createById != ''">and TCM.create_by_id = #{createById}</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and TCM.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
+ <if test="itemExpenseId != null and itemExpenseId != ''">and TCMI.expense_id = #{itemExpenseId}</if>
|
|
|
+ <if test="itemBelongsProjectId != null and itemBelongsProjectId != ''">and TCMI.belongs_project_id =
|
|
|
+ #{itemBelongsProjectId}
|
|
|
+ </if>
|
|
|
+ <if test="itemDepartment != null and itemDepartment != ''">and TCMI.department_id = #{itemDepartment}</if>
|
|
|
+ <if test="itemPersonnel != null and itemPersonnel != ''">and TCMI.personnel_id = #{itemPersonnel}</if>
|
|
|
+ <if test="itemMatterName != null and itemMatterName != ''">and TCMI.matter_name like concat('%',
|
|
|
+ #{itemMatterName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">and TCM.remark like concat('%', #{remark}, '%')</if>
|
|
|
+ </where>
|
|
|
+ order by TCM.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|