注册

sql转化成达梦报错

酒玖 2024/07/31 361 1

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:8
【操作系统】:
【CPU】:
【问题描述】*:
@Query(value = "SELECT * from people_sys_label_relation pr " +
"LEFT JOIN base_people bp on pr.people_id=bp.id " +
"LEFT JOIN base_people_isolation_info bpii on pr.people_id=bpii.people_id " +
" where pr.del_flag=0 and bp.del_flag=0 and bpii.del_flag=0 and pr.sys_label_id =1 and bp.region_id in ?1 " +
" and (?2 IS NULL OR ?2 = '' OR bp.name like %?2% )" +
" and (?3 IS NULL OR ?3 = '' OR bp.phone like %?3% ) " +
" and (?4 IS NULL OR ?4 = '' OR bp.id_card like %?4% ) " +
" and (?13 IS NULL OR ?13 = '' OR bpii.create_time >=?13 ) " +
" and (?14 IS NULL OR ?14 = '' OR bpii.create_time <=?14 ) " +
"and (case ?5 when 1 then ((SELECT count(1) from WISDOMBIYI.safe_isolation_device_info where del_flag=0 and people_id=bp.id)>0) " +
"when 0 then ((SELECT count(1) from safe_isolation_device_info where del_flag=0 and people_id=bp.id)<1) else 1=1 end ) " +
"and (case ?6 when 1 then (bpii.GLKSSJ<=now() and bpii.YQJCGLSJ>=now()) " +
"when 0 then (bpii.YQJCGLSJ<now() or bpii.GLKSSJ>now()) else 1=1 end ) " +
"and (case ?7 when 1 then (bpii.GLKSSJ<=now() and bpii.YQJCGLSJ>=NOW() and bpii.BQ = 1 and bpii.is_install = 1) " +
"when 0 then (bpii.YQJCGLSJ<NOW() or bpii.GLKSSJ>now() ) else 1=1 end ) " +
" and (?8 IS NULL OR ?8 = '' OR bp.wj_community_name like %?8% ) "+
"and (case ?9 when 3 then (bp.trusteeship =3) " +
"when 0 then (bp.trusteeship !=3) else 1=1 end )"+
"and (?10 IS NULL OR ?10 = '' OR to_days(bpii.create_time) = to_days(now()) ) "+
"and (case ?11 when 1 then (bpii.is_install =1) " +
"when 0 then (bpii.is_install =0) else 1=1 end )"+
"and (case ?12 when 1 then (bpii.RYLB =1) " +
"when 2 then (bpii.RYLB =2) " +
"when 3 then (bpii.RYLB =3) " +
"when 4 then (bpii.RYLB =4) " +
"when 5 then (bpii.RYLB =5) " +
"when 6 then (bpii.RYLB =6) " +
"when 7 then (bpii.RYLB =7) " +
"when 8 then (bpii.RYLB =8) " +
"when 9 then (bpii.RYLB =9) " +
"when 11 then (bpii.RYLB =11) " +
"when 10 then (bpii.RYLB =10)" +
"when 12 then (bpii.RYLB =12) " +
"when 13 then (bpii.RYLB =13)" +
"when 14 then (bpii.RYLB =14) " +
"when 15 then (bpii.RYLB =15) " +
"when 16 then (bpii.RYLB =16) else 1=1 end )",nativeQuery = true)
Page<PeopleLabelRelation> findByIsoPeopleCondition(Set<Integer> ids, String name, String phone, String idCard
, Integer isBind, Integer isIsolation, String timeType, String wjCommunityName, Integer trusteeship, String jrxzType, Integer isInstall, Integer peopleType, Date dateFrom, Date dateTo, Pageable pageable);
上述是sql产生的地址,下面是报错image.pngimage.png

回答 0
暂无回答
扫一扫
联系客服