@ServicepublicclassSimpleUserService{@AutowiredprivateJooqTemplatejt;publicList<user>selectUserInDept(UserParamparam){//If deptIDs==null or deptIDs. isEmpty automatically ignores this query condition// SELECT * FROM user_table WHERE name LIKE '%?%' AND dept_id IN (?,?...);returnjt.queryv("user_table",User.class,"name%",param.getName(),"dept_id:in",param.getDeptIds());}publicList<user>selectUserNotInDept(UserParamparam){// SELECT * FROM user_table WHERE name LIKE '%?%' AND dept_id NOT IN (?,?...);returnjt.queryv("user_table",User.class,"name%",param.getName(),"dept_id:notin",param.getDeptIds());}}
Top comments (0)
Subscribe
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)