为了使MyBatis查询更加方便,UJCMS使用了查询解析器。相关代码的包名:com.ujcms.commons.query
只检索本表字段。
# t.username_ like ?
Like_username
# t.price_ = ?
EQ_price_Int
# 符合规则的
# join ujcms_user user_ on t.user_id_ = user_.id_
# user_.usernmae like ?
Like_user-username
# 不符合规则的
# join ujcms_user editUser_ on t.edit_user_id_ = user_.id_
# editUser_.usernmae like ?
Like_editUser@user-username
# join ujcms_user_ext userExt_ on t.id_ = userExt_.id_
# userExt_.real_name_ like ?
Like_@userExt-realName
# 符合规则的
# join ujcms_user_role UserRole_ on t.id_ = UserRole_.user_id_
# UserRole_.real_name_ like ?
Like_user@UserRole-realName
# 不符合规则的
# join ujcms_channel_tree ChannelTree_ on t.channel_id_ = ChannelTree_.descendant_id_
# ChannelTree_.ancestor_id_ = ?
In_channel@ChannelTree@descendant-ancestorId_Int
# 一级分组
# join ujcms_question_ext questionExt_ on t.question_ext_id_ = questionExt_.id_
# (questionExt_.title_ like ? or questionExt_.markdown_ like ?)
Like_1_questionExt-title
Like_1_questionExt-markdown
# 二级分组
# join ujcms_dict_type dictType_ on t.type_id_ = dictType_.id_
# (dictType_.alias_ = ? and dictType_.scope_ = ?) or (dictType_.alias_ = ? and dictType_.site_id_ = ?)
EQ_1-1_type@dictType-alias
EQ_1-2_type@dictType-scope
EQ_2-1_type@dictType-alias
EQ_2-2_type@dictType-siteId
# join ujcms_user editUser_ on t.edit_user_id_ = editUser_.id_
# join ujcms_user_ext userExt_ on editUser_.user_ext_id_ = userExt_.id_
# editUser_.username_ = ?
Like_editUser@user-userExt-username
like
,支持通配符,如%
%name%
name%
%name
=
equals!=
not equals>
greater than>=
greater than or equal to<
less then<=
less than or equal toin
not in
is null
is not null
默认为String