${if(len(MODEL_NAME) == 0,"SELECT MODEL_NAME,PROCESS,NAME,TERMINAL_ID,MAX_VALUE,MIN_VALUE,STANDARD_VALUE,'level'||PRIORITY as PRIORITY FROM PLC.PARAM_STANDARD WHERE PRIORITY=9", "SELECT MODEL_NAME,PROCESS,NAME,TERMINAL_ID,MAX_VALUE,MIN_VALUE,STANDARD_VALUE,'level'||PRIORITY as PRIORITY FROM PLC.PARAM_STANDARD WHERE 1=1 ")} ${if(len(PROCESS) == 0, "", " and PROCESS = '" + PROCESS + "'" )}
用户W3018806 回复 CD20160914你的${if(len(MODEL_NAME) == 0,\"SELECT MODEL_NAME,PROCESS,NAME,TERMINAL_ID,MAX_VALUE,MIN_VALUE,STANDARD_VALUE,\'level\'||PRIORITY as PRIORITY FROM PLC.PARAM_STANDARD WHERE PRIORITY=9\", \"SELECT MODEL_NAME,PROCESS,NAME,TERMINAL_ID,MAX_VALUE,MIN_VALUE,STANDARD_VALUE,\'level\'||PRIORITY as PRIORITY FROM PLC.PARAM_STANDARD WHERE 1=1 \")} 这里写的有问题if(条件真,\"拼接这里\",\"否则拼接这里\") 你直接写个SELECT 查询是要干嘛
SELECT MODEL_NAME,PROCESS,NAME,TERMINAL_ID,MAX_VALUE,MIN_VALUE,STANDARD_VALUE,'level'||PRIORITY as PRIORITY FROM PLC.PARAM_STANDARD WHERE 1=1 ${if(len(MODEL_NAME)==0," and PRIORITY=9"," and MODEL_NAME='"+MODEL_NAME+"'")} ${if(len(PROCESS) == 0, "", " and PROCESS = '" + PROCESS + "'" )} .......................