1.9 KiB
queryByCondition
-
根据不为空的参数进行分页查询
select @pageTag(){ t.* @} from attachments t where 1=1
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("attachments.query")# @if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(createdAt)){ and t.created_at =#createdAt# @} @if(!isEmpty(updatedAt)){ and t.updated_at =#updatedAt# @} @if(!isEmpty(data)){ and t.data =#data# @} @if(!isEmpty(type)){ and t.type =#type# @} @if(!isEmpty(path)){ and t.path =#path# @} @if(!isEmpty(name)){ and t.name =#name# @}
deleteAttachmentsByIds
-
批量删除
delete from attachments where find_in_set(id,#ids#)
getAttachmentsValues
-
根据不为空的参数进行查询
select t.* from attachments t where 1=1
@if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(createdAt)){ and t.created_at =#createdAt# @} @if(!isEmpty(updatedAt)){ and t.updated_at =#updatedAt# @} @if(!isEmpty(data)){ and t.data =#data# @} @if(!isEmpty(type)){ and t.type =#type# @} @if(!isEmpty(path)){ and t.path =#path# @} @if(!isEmpty(name)){ and t.name =#name# @}
getValuesByQuery
-
根据不为空的参数进行查询
select t.* from attachments t where 1=1
@if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(createdAt)){ and t.created_at =#createdAt# @} @if(!isEmpty(updatedAt)){ and t.updated_at =#updatedAt# @} @if(!isEmpty(data)){ and t.data =#data# @} @if(!isEmpty(type)){ and t.type =#type# @} @if(!isEmpty(path)){ and t.path =#path# @} @if(!isEmpty(name)){ and t.name =#name# @}