NutzCN Logo
问答 关于在使用dao层时,如何来动态拼接若干个参数?
发布于 2858天前 作者 qq_6c5a7e9a 1745 次浏览 复制 上一个帖子 下一个帖子
标签:

有的时候做列表页,前端页面要传很多参数过来,为Null的参数可能就不需要,Java代码里不出现SQL的情况下,在SQL文件里怎么来拼接?

4 回复

考虑一下nutzmore项目里面的sqltpl插件

另外,Cnd类有andEX和orEX,也能实现类似要求

二月 25, 2017 1:51:51 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:HeTaro' did not find a matching property.
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/9.0.0.M15
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Dec 5 2016 13:44:25 UTC
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         9.0.0.0
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 7
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.1
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java\jre1.8.0_92
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.8.0_92-b14
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         E:\Tomcat-9.0.0.M15
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         E:\Tomcat-9.0.0.M15
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:62664
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=E:\Tomcat-9.0.0.M15
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=E:\Tomcat-9.0.0.M15
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=E:\Tomcat-9.0.0.M15\webapps
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=E:\Tomcat-9.0.0.M15\endorsed
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
二月 25, 2017 1:51:51 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_92\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_92/bin/server;C:/Program Files/Java/jre1.8.0_92/bin;C:/Program Files/Java/jre1.8.0_92/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;E:\Git\cmd;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;D:\Tesseract-OCR;C:\Program Files\TortoiseGit\bin;D:\HuTao\SVN\bin;C:\Users\java\AppData\Roaming\npm;C:\Program Files\Java\jdk1.8.0_92\bin;C:\Program Files\Java\jdk1.8.0_92\jre\bin;C:\Program Files\Bandizip\7z;E:\eclipse;;.
二月 25, 2017 1:51:51 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
二月 25, 2017 1:51:51 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
二月 25, 2017 1:51:51 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
二月 25, 2017 1:51:51 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
二月 25, 2017 1:51:51 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 484 ms
二月 25, 2017 1:51:51 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 25, 2017 1:51:51 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/9.0.0.M15
二月 25, 2017 1:51:52 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[INFO ] 13:51:52.257 org.nutz.mvc.NutFilter._init(NutFilter.java:81) - NutFilter[nutz] starting ...
[DEBUG] 13:51:52.301 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=E:\eclipse], Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar], Dir[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes], Jar[path=E:\Tomcat-9.0.0.M15\bin\bootstrap.jar], Jar[path=E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar]]
[DEBUG] 13:51:52.353 org.nutz.resource.Scans.init(Scans.java:105) - Locations for Scans:
{E:\eclipse=Dir[path=E:\eclipse], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes=Dir[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes], E:\Tomcat-9.0.0.M15\bin\bootstrap.jar=Jar[path=E:\Tomcat-9.0.0.M15\bin\bootstrap.jar], E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar=Jar[path=E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\log4j-1.2.17.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\druid-1.0.28.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\druid-1.0.28.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\postgresql-9.3-1102.jdbc41.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\postgresql-9.3-1102.jdbc41.jar]}
[DEBUG] 13:51:52.397 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 13:51:52.402 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 13:51:52.404 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.60 
[INFO ] 13:51:52.404 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ...
[DEBUG] 13:51:52.404 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) - Web Container Information:
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) -  - Default Charset : UTF-8
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) -  - Current . path  : E:\eclipse\.
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) -  - Java Version    : 1.8.0_92
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) -  - File separator  : \
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) -  - Timezone        : Asia/Shanghai
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) -  - OS              : Windows 7 amd64
[DEBUG] 13:51:52.405 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) -  - ServerInfo      : Apache Tomcat/9.0.0.M15
[DEBUG] 13:51:52.406 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) -  - Servlet API     : 4.0
[DEBUG] 13:51:52.406 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) -  - ContextPath     : 
[DEBUG] 13:51:52.406 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) -  - context.tempdir : E:\Tomcat-9.0.0.M15\work\Catalina\localhost\ROOT
[DEBUG] 13:51:52.407 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) -  - MainModule      : hutao.hetaro.modules.MainModules
[DEBUG] 13:51:52.408 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) - >> app.root = E:/Tomcat-9.0.0.M15/webapps/HeTaro
[INFO ] 13:51:52.408 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:399) - !!!Your application without @IocBy supporting
[INFO ] 13:51:52.412 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
[DEBUG] 13:51:52.413 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) - @Views(DefaultViewMaker.class)
[DEBUG] 13:51:52.421 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
[DEBUG] 13:51:52.426 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/E:/Tomcat-9.0.0.M15/webapps/HeTaro/WEB-INF/classes/'
[DEBUG] 13:51:52.426 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) -  > scan 'hutao.hetaro.modules'
[DEBUG] 13:51:52.430 org.nutz.resource.Scans.scan(Scans.java:274) - Found 2 resource by src( hutao/hetaro/modules/ ) , regex( ^.+[.]class$ )
[WARN ] 13:51:52.430 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:184) - None module classes found!!!
[WARN ] 13:51:52.430 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:218) - None @At found in any modules class!!
[DEBUG] 13:51:52.431 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:334) - @Localization not define
[INFO ] 13:51:52.432 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 24ms
二月 25, 2017 1:51:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory E:\Tomcat-9.0.0.M15\webapps\HeTaro
二月 25, 2017 1:51:52 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[INFO ] 13:51:52.747 org.nutz.mvc.NutFilter._init(NutFilter.java:81) - NutFilter[nutz] starting ...
[DEBUG] 13:51:52.792 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=E:\eclipse], Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar], Dir[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes], Jar[path=E:\Tomcat-9.0.0.M15\bin\bootstrap.jar], Jar[path=E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar]]
[DEBUG] 13:51:52.853 org.nutz.resource.Scans.init(Scans.java:105) - Locations for Scans:
{E:\eclipse=Dir[path=E:\eclipse], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\nutz-1.r.60.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes=Dir[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\classes], E:\Tomcat-9.0.0.M15\bin\bootstrap.jar=Jar[path=E:\Tomcat-9.0.0.M15\bin\bootstrap.jar], E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar=Jar[path=E:\Tomcat-9.0.0.M15\bin\tomcat-juli.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\log4j-1.2.17.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\druid-1.0.28.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\druid-1.0.28.jar], E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\postgresql-9.3-1102.jdbc41.jar=Jar[path=E:\Tomcat-9.0.0.M15\webapps\HeTaro\WEB-INF\lib\postgresql-9.3-1102.jdbc41.jar]}
[DEBUG] 13:51:52.901 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 13:51:52.907 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 13:51:52.909 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.60 
[INFO ] 13:51:52.909 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ...
[DEBUG] 13:51:52.909 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) - Web Container Information:
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) -  - Default Charset : UTF-8
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) -  - Current . path  : E:\eclipse\.
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) -  - Java Version    : 1.8.0_92
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) -  - File separator  : \
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) -  - Timezone        : Asia/Shanghai
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) -  - OS              : Windows 7 amd64
[DEBUG] 13:51:52.910 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) -  - ServerInfo      : Apache Tomcat/9.0.0.M15
[DEBUG] 13:51:52.911 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) -  - Servlet API     : 4.0
[DEBUG] 13:51:52.911 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) -  - ContextPath     : /HeTaro
[DEBUG] 13:51:52.911 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) -  - context.tempdir : E:\Tomcat-9.0.0.M15\work\Catalina\localhost\HeTaro
[DEBUG] 13:51:52.911 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) -  - MainModule      : hutao.hetaro.modules.MainModules
[DEBUG] 13:51:52.912 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:238) - >> app.root = E:/Tomcat-9.0.0.M15/webapps/HeTaro
[INFO ] 13:51:52.912 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:399) - !!!Your application without @IocBy supporting
[INFO ] 13:51:52.914 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
[DEBUG] 13:51:52.915 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:369) - @Views(DefaultViewMaker.class)
[DEBUG] 13:51:52.925 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:266) - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
[DEBUG] 13:51:52.931 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) - module class location 'file:/E:/Tomcat-9.0.0.M15/webapps/HeTaro/WEB-INF/classes/'
[DEBUG] 13:51:52.931 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) -  > scan 'hutao.hetaro.modules'
[DEBUG] 13:51:52.935 org.nutz.resource.Scans.scan(Scans.java:274) - Found 2 resource by src( hutao/hetaro/modules/ ) , regex( ^.+[.]class$ )
[WARN ] 13:51:52.938 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:184) - None module classes found!!!
[WARN ] 13:51:52.938 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:218) - None @At found in any modules class!!
[DEBUG] 13:51:52.940 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:334) - @Localization not define
[INFO ] 13:51:52.942 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) - Nutz.Mvc[nutz] is up in 31ms
二月 25, 2017 1:51:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory E:\Tomcat-9.0.0.M15\webapps\HeTaro has finished in 501 ms
二月 25, 2017 1:51:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [http-nio-8080]
二月 25, 2017 1:51:52 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [ajp-nio-8009]
二月 25, 2017 1:51:52 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 1367 ms

为什么NUtz启动了两次?

添加回复
请先登陆
回到顶部