select sku.ID as ID
from sku, rule
where rule.status = 1 and rule.type = 3
#if(${channelId})
and rule.channelId = ${channelId}
#end
and rule.ID = sku.ID
#if(${refLogic})
and rule.refLogic= ${refLogic}
#end
and sku.cycleStatus<> 0有这样一个语句,不知道#if #end $(channelId)这各写法是什么意思?请高手指点!!!!
from sku, rule
where rule.status = 1 and rule.type = 3
#if(${channelId})
and rule.channelId = ${channelId}
#end
and rule.ID = sku.ID
#if(${refLogic})
and rule.refLogic= ${refLogic}
#end
and sku.cycleStatus<> 0有这样一个语句,不知道#if #end $(channelId)这各写法是什么意思?请高手指点!!!!
这个意思就是 如果 ${变量名} 不为空,就加一个条件