|
|
@ -1,7 +1,19 @@ |
|
|
|
package com.kms.yxgh.df.mapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.kms.yxgh.common.dto.ApprovalDetailDto; |
|
|
|
import com.kms.yxgh.common.dto.ApprovalSearchDto; |
|
|
|
import com.kms.yxgh.common.mapper.handler.DocHandler; |
|
|
|
import com.kms.yxgh.common.mapper.handler.OperatorHandler; |
|
|
|
import com.kms.yxgh.df.domain.DfYhV2V2; |
|
|
|
import com.kms.yxgh.df.dto.v2.DfRecordSearchV2Dto; |
|
|
|
import com.kms.yxgh.df.dto.v2.DfYhApproveDto; |
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
import org.apache.ibatis.annotations.Result; |
|
|
|
import org.apache.ibatis.annotations.Results; |
|
|
|
import org.apache.ibatis.annotations.Select; |
|
|
|
import org.springframework.stereotype.Repository; |
|
|
|
|
|
|
|
/** |
|
|
@ -13,5 +25,50 @@ import org.springframework.stereotype.Repository; |
|
|
|
@Repository |
|
|
|
public interface DfYhV2Mapper extends BaseMapper<DfYhV2V2> { |
|
|
|
|
|
|
|
|
|
|
|
@Select("<script> " + |
|
|
|
" SELECT ts.id id, ts.form_id formId, ts.create_time submit_time, ts.approval_time approval_time, ts.status " + |
|
|
|
" status, " + |
|
|
|
" ts.operator operator, ts.comment comment, ts.doc ts_doc, " + |
|
|
|
" jl.id , jl.name ,jl.dike_code dikeCode, jl.dike_name dikeName, jl.type type, jl.category category, " + |
|
|
|
" jl.issue_level issueLevel, jl.duty_holder_id dutyHolderId, jl.duty_holder_name dutyHolderName " + |
|
|
|
" FROM bs_sgc_sp_task ts " + |
|
|
|
" LEFT JOIN bs_sgc_df_xcyj jl ON jl.id = ts.form_id " + |
|
|
|
" WHERE ts.business_type = #{dto.businessType} " + |
|
|
|
" <if test='dto.status != null and dto.status != \"\"'> " + |
|
|
|
" AND ts.status = #{dto.status} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.name != null'> " + |
|
|
|
" AND jl.name LIKE CONCAT('%',#{dto.condition.name},'%') " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.type != null and dto.condition.type != \"\"'> " + |
|
|
|
" AND jl.type = #{dto.condition.type} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.category != null and dto.condition.category != \"\"'> " + |
|
|
|
" AND jl.category = #{dto.condition.category} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.problemLevel != null and dto.condition.problemLevel != \"\"'> " + |
|
|
|
" AND jl.issue_level = #{dto.condition.problemLevel} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.status != null and dto.condition.status != \"\"'> " + |
|
|
|
" AND jl.status = #{dto.condition.status} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.startDate != null and dto.condition.startDate != \"\"'> " + |
|
|
|
" AND jl.start_date >= #{dto.condition.startDate} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.endDate != null and dto.condition.endDate != \"\"'> " + |
|
|
|
" AND jl.end_date <= #{dto.condition.endDate} " + |
|
|
|
" </if> " + |
|
|
|
" <if test='dto.condition!= null and dto.condition.dutyHolder != null and dto.condition.dutyHolder != \"\"'> " + |
|
|
|
" AND jl.duty_holder_id = #{dto.condition.dutyHolder} " + |
|
|
|
" </if> " + |
|
|
|
" ORDER BY jl.update_time DESC </script>") |
|
|
|
@Results(id = "approvalSearchPage", value = { |
|
|
|
@Result(column = "operator", property = "operator", typeHandler = OperatorHandler.class), |
|
|
|
@Result(column = "ts_doc", property = "doc", typeHandler = DocHandler.class), |
|
|
|
@Result(column = "id", property = "formId"), |
|
|
|
@Result(column = "form_id", property = "formId"), |
|
|
|
@Result(column = "create_time", property = "submitTime"), |
|
|
|
@Result(column = "approval_time", property = "approvalTime"), |
|
|
|
}) |
|
|
|
IPage<ApprovalDetailDto<DfYhApproveDto>> approvalSearchPage(Page<DfRecordSearchV2Dto> page, @Param("dto") ApprovalSearchDto<DfRecordSearchV2Dto> data); |
|
|
|
} |
|
|
|