@Select({"<script> select cor.risk_id,cor.create_by as leader,cor.create_time as put_forward_time," +
"cor.correct_user_name as handle,cor.update_time as handle_time," +
"cor.correct_end_time,cor.correct_status,risk.risk_name,rt.risk_name as risk_type,pro.pro_code," +
"pro.pro_name,pro.pro_leader_name as pro_leader,pt.type_name as pro_type from data_risk_correct cor " +
"left join data_project_risk risk on cor.risk_id=risk.risk_id " +
"left join data_risk_type rt on risk.risk_type_id=rt.risk_id " +
"left join data_project pro on risk.pro_id=pro.pro_id " +
"left join data_project_type pt on pro.pro_type_id=pt.type_id " +
"<where>"+
"<if test='riskCenterVo.riskName != null and riskCenterVo.riskName !=\"\"'>" +
" and risk.risk_name like concat('%',#{riskCenterVo.riskName},'%') " +
"</if>" +
"<if test='riskCenterVo.proName != null and riskCenterVo.proName !=\"\"'>" +
" and pro.pro_name like concat('%',#{riskCenterVo.proName},'%') " +
"</if>" +
"<if test='riskCenterVo.proCode != null and riskCenterVo.proCode !=\"\"'>" +
" and pro.pro_code =#{riskCenterVo.proCode} " +
"</if>" +
"<if test='riskCenterVo.correctStatus != null '>" +
" and cor.correct_status=#{riskCenterVo.correctStatus} " +
"</if>" +
"</where>" +
"and cor.is_delete=0 and cor.correct_user_id=#{userId}" +
"</script>"})
List<RiskCenterVo> selectRiskCenterList(@Param("riskCenterVo") RiskCenterVo riskCenterVo,@Param("userId") String userId);
mybatis-plus @select 动态查询
最新推荐文章于 2024-03-02 16:03:13 发布