美文网首页
mybaits if 标签中使用枚举判断

mybaits if 标签中使用枚举判断

作者: 小李_a98e | 来源:发表于2019-06-03 16:29 被阅读0次

mybaits if 标签中使用枚举判断

  • 枚举定义

package com.example.demo.enums;

public enum TaskType {
    IS_MY(0,"我参与的"),
    MY_DISPATCH(1,"我分配的"),
    MY_CHARGE(2,"我负责的");
    private  Integer code;
    private  String value;
    TaskType(Integer code,String value){
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
  • if标签中使用

<if test="cityName == @com.weather.weatherexpert.common.utils.City@XINZHOU.getName"><!--right-->
        area_table
</if>

相关文章

网友评论

      本文标题:mybaits if 标签中使用枚举判断

      本文链接:https://www.haomeiwen.com/subject/pdacxctx.html