agoodcoolman commented on issue #14336:
URL:
https://github.com/apache/shardingsphere/issues/14336#issuecomment-1001347254
```
Pageable pageable = PageRequest.of(1, 12);
Page<Csvjyjz> jiuZhuBeans = csvjyjzDAO.queryAllByYear(
String.valueOf(year), StringUtils.isEmpty(name)? null:
name,StringUtils.isEmpty(idcard)? null: idcard,pageable);
```
@Query(value = "select id, name, idcard, '' as address, '' as school from
(" +
"select id, name, idcard from csvone where CASE WHEN
COALESCE(:name,'1') = '1' THEN 1=1 ELSE name like :name% END and CASE WHEN
COALESCE(:idcard,'1') = '1' THEN 1=1 ELSE idcard like :idcard% END " +
" union " +
" select id, name, idcard from csvtwo where CASE WHEN
COALESCE(:name1,'1') +
") re"
,nativeQuery = true)
Page<Csv> queryAllByYear (Pageable Pageable, @Param("year")String year,
@Param("name")String name, @Param("idcard")String idcard,
@Param("year1")String year1,
@Param("name1")String name1, @Param("idcard1")String idcard1);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]