Tag Archives: use

Nutz framework: using native SQL for CND conditions

case

Today, I received a temporary business requirement. It takes a day or two for a simple filter to be used as a temporary business. So I thought of adding a not like to the original CND condition for filtering. However, I found that the existing CND condition query does not seem to meet the requirement

 

Solution

Using static class in Nutz framework to realize custom SQL and Cnd.and () splicing, new static (“xxxxx”) can connect any native SQL

 

cnd.and( new Static("job.ADDRESS not like '%GuangDong%'") );