本文共 703 字,大约阅读时间需要 2 分钟。
mybatis使用java实体中定义的常量
示例代码:
SELECT dea.uid uid, dea.enabled_flag enabledFlag, dea.delete_flag deleteFlag, dea.tenement_id tenementId, dea.parent_id parentId, pd.name parentName, con.name contactName, con.mobile mobile FROM dealer AS dea LEFT JOIN (SELECT a.* FROM contact AS a where tenement_id = #{tenementId} and main_contact = ${@com.pisen.cloud.luna.ms.dealer.base.domain.Contact@IS_MAIN}) con ON dea.uid = con.dealer_id LEFT JOIN dealer pd on pd.uid = dea.parent_id WHERE dea.tenement_id = #{tenementId}
格式:
${@实体包完整路径@常量名}
转载于:https://www.cnblogs.com/sxdcgaq8080/p/9205495.html