|
|
@ -5,11 +5,15 @@ 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.ListSupplementHandler; |
|
|
|
import com.kms.yxgh.common.mapper.handler.OperatorHandler; |
|
|
|
import com.kms.yxgh.df.domain.DfYhRecord; |
|
|
|
import com.kms.yxgh.df.dto.DfYhRecordApprovalDto; |
|
|
|
import com.kms.yxgh.df.dto.DfYhRecordDetailDto; |
|
|
|
import com.kms.yxgh.df.dto.DfYhRecordSearchDto; |
|
|
|
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; |
|
|
|
|
|
|
@ -25,46 +29,48 @@ import java.util.Date; |
|
|
|
public interface DfYhRecordMapper extends BaseMapper<DfYhRecord> { |
|
|
|
|
|
|
|
@Select("<script>" + |
|
|
|
"SELECT yhjl.id, yhjl.plan_id, yhjl.name, yhjl.before, yhjl.middle, yhjl.after, " + |
|
|
|
"yhjl.maintenance_funds, yhjl.implement, yhjl.status, df.dike_code, df.dike_name, " + |
|
|
|
"yhjl.create_time, yhjl.update_time " + |
|
|
|
"SELECT yhjl.id, yhjl.plan_id, yhjl.name, yhjl.status, yhjl.supplement," + |
|
|
|
"yhjl.doc, yhjl.ledger_doc, yhjl.remark, yhjl.create_time, yhjl.update_time, " + |
|
|
|
"df.dike_code, df.dike_name, df.dike_type " + |
|
|
|
"jh.responsible_person " + |
|
|
|
"FROM bs_sgc_df_yhjl yhjl " + |
|
|
|
"LEFT JOIN bs_sgc_df_gcda df ON yhjl.dike_code = df.dike_code " + |
|
|
|
"LEFT JOIN bs_sgc_df_yhjh jh ON jh.id = yhjl.plan_id " + |
|
|
|
"LEFT JOIN att_dike_base df ON yhjl.dike_code = df.dike_code and df.expr_date is null " + |
|
|
|
"WHERE 1=1 " + |
|
|
|
"and df.expr_date is null " + |
|
|
|
"<if test='searchDto.dikeCode != null '>" + |
|
|
|
"AND yhjl.dike_code = #{searchDto.dikeCode} " + |
|
|
|
"AND df.dike_code = #{searchDto.dikeCode} " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.startCreatedTime != null'>" + |
|
|
|
"AND yhjl.create_time >= #{searchDto.startCreatedTime} " + |
|
|
|
"<if test='searchDto.dikeName != null '>" + |
|
|
|
"AND df.dike_name LIKE CONCAT('%',#{searchDto.dikeName},'%') " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.endCreatedTime != null'>" + |
|
|
|
"AND yhjl.create_time <= #{searchDto.endCreatedTime} " + |
|
|
|
"<if test='searchDto.dikeType != null '>" + |
|
|
|
"AND df.dike_type = #{searchDto.dikeType} " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.startUpdateTime != null'>" + |
|
|
|
"AND yhjl.update_time >= #{searchDto.startUpdateTime} " + |
|
|
|
"<if test='searchDto.startDate != null '>" + |
|
|
|
"AND jh.start_date >= #{searchDto.startDate} " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.endUpdateTime != null'>" + |
|
|
|
"AND yhjl.update_time <= #{searchDto.endUpdateTime} " + |
|
|
|
"<if test='searchDto.endDate != null '>" + |
|
|
|
"AND jh.end_date <= #{searchDto.endDate} " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.status != null and !searchDto.status.isEmpty()'>" + |
|
|
|
"AND yhjl.status = #{searchDto.status} " + |
|
|
|
"<if test='searchDto.name != null '>" + |
|
|
|
"AND jh.name LIKE CONCAT('%',#{searchDto.name},'%') " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.minRepairCost != null'>" + |
|
|
|
"AND yhjl.maintenance_funds >= #{searchDto.minRepairCost} " + |
|
|
|
"</if>" + |
|
|
|
"<if test='searchDto.maxRepairCost != null'>" + |
|
|
|
"AND yhjl.maintenance_funds <= #{searchDto.maxRepairCost} " + |
|
|
|
"<if test='searchDto.adcd != null '>" + |
|
|
|
"AND df.adcd LIKE CONCAT(#{searchDto.adcd},'%') " + |
|
|
|
"</if>" + |
|
|
|
"ORDER BY yhjl.create_time DESC" + |
|
|
|
"</script>") |
|
|
|
@Results({ |
|
|
|
@Result(column = "responsible_person", property = "responsiblePerson", typeHandler = OperatorHandler.class), |
|
|
|
@Result(column = "supplement", property = "supplements", typeHandler = ListSupplementHandler.class), |
|
|
|
@Result(column = "doc", property = "doc", typeHandler = ListSupplementHandler.class), |
|
|
|
@Result(column = "ledger_doc", property = "ledgerDoc", typeHandler = ListSupplementHandler.class) |
|
|
|
}) |
|
|
|
IPage<DfYhRecordDetailDto> searchPage(IPage<DfYhRecordDetailDto> page, @Param("searchDto") DfYhRecordSearchDto searchDto); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Select("SELECT MAX(create_time) FROM bs_sgc_df_yhjl WHERE dike_code = #{dikeCode} ") |
|
|
|
Date getLastInsertTimeByDikeCode(@Param("dikeCode") String dikeCode); |
|
|
|
|
|
|
|
IPage<ApprovalDetailDto<DfYhRecordApprovalDto>> approvalSearchPage(Page<DfYhRecordSearchDto> page,@Param("dto") ApprovalSearchDto<DfYhRecordSearchDto> data); |
|
|
|
IPage<ApprovalDetailDto<DfYhRecordApprovalDto>> approvalSearchPage(Page<DfYhRecordSearchDto> page, @Param("dto") ApprovalSearchDto<DfYhRecordSearchDto> data); |
|
|
|
} |
|
|
|