mybatis 判断条件引入常量
·
常量定义
public class TestCfg {
public static final String LX_ID = "lx_id";
public static boolean isLxId (String lxId){
return LX_ID_WBDWJKF.equals(lxId);
}
}
mybaits 引用
<if test="@com.test.constant.TestCfg@isLxId (lxId)">
判断数字
private int intNum;
<if test="intNum == 1 "> </if>
判断数字字符串
private String strNum;
<if test="strNum == '1'.toString() "> </if>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)