#foreach ($column in $columns)
#end
#if($table.sub)
#foreach ($column in $subTable.columns)
#end
#end
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
#foreach($column in $columns)
#set($queryType=$column.queryType)
#set($javaField=$column.javaField)
#set($javaType=$column.javaType)
#set($columnName=$column.columnName)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query)
#if($column.queryType == "EQ")
and $columnName = #{$javaField}
#elseif($queryType == "NE")
and $columnName != #{$javaField}
#elseif($queryType == "GT")
and $columnName > #{$javaField}
#elseif($queryType == "GTE")
and $columnName >= #{$javaField}
#elseif($queryType == "LT")
and $columnName < #{$javaField}
#elseif($queryType == "LTE")
and $columnName <= #{$javaField}
#elseif($queryType == "LIKE")
and $columnName like concat('%', #{$javaField}, '%')
#elseif($queryType == "BETWEEN")
and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}
#end
#end
#end