关于Ibatis的isNotEqual 中的compareValue用法

FaFaNutrition 2013-12-26 04:29:51
我不知道这个用法,最近项目用到Ibatis ,可我从来没有用过Ibatis
想请教一下 isNotEqual 中的compareValue用法

今天项目中抛出如下异常:

Error comparing in conditional fragment. Uknown 'compare to' values.

哪位大神帮我解决了,立马给分
...全文
10047 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
FaFaNutrition 2013-12-26
  • 打赏
  • 举报
回复
问题解决了,分全部给你,而且还关注了你,谢谢啦
firein 2013-12-26
  • 打赏
  • 举报
回复
另外提一点 条件部 注意加 and
firein 2013-12-26
  • 打赏
  • 举报
回复
如果你非得用isNotEqual 那应该是 <isNotEqual property="begin_date" compareValue="">
firein 2013-12-26
  • 打赏
  • 举报
回复
你这个是想判断值是否为空吧 <isNotEqual property="begin_date" > 用isNotEmpty就可以了
FaFaNutrition 2013-12-26
  • 打赏
  • 举报
回复
CheckForm.java:

public class CheckForm extends ActionForm {
    
    private int latn_id;
    
    private int type;
    
    private String begin_date;
    
    private String end_date;
    
    private int state;

	public int getLatn_id() {
		return latn_id;
	}

	public void setLatn_id(int latnId) {
		latn_id = latnId;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getBegin_date() {
		return begin_date;
	}

	public void setBegin_date(String beginDate) {
		begin_date = beginDate;
	}

	public String getEnd_date() {
		return end_date;
	}

	public void setEnd_date(String endDate) {
		end_date = endDate;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

}
FaFaNutrition 2013-12-26
  • 打赏
  • 举报
回复
sql如下:
<select id="getCheckResult" parameterClass="com.dic.webabm.form.CheckForm" resultClass="com.dic.webabm.domain.CheckResult">
	    select  to_char(to_date(pay_date, 'yyyy-mm-dd'),'yyyy-mm-dd') as pay_date,
			    ocs_amount*0.01 as ocs_amount,
			    abm_amount*0.01 as  abm_amount,
			    decode(state,1,'平衡',2,'不平衡') as state 
	    from    tb_abm_dz_result
        where 
         <dynamic>
            <isNotEqual  property="begin_date" >
                to_date(pay_date, 'yyyy-mm-dd') >=to_date(#begin_date#,'yyyy-mm-dd')
            </isNotEqual>
        </dynamic>
        <dynamic>
            <isNotEqual  property="end_date" >
                to_date(pay_date, 'yyyy-mm-dd') < to_date(#end_date#,'yyyy-mm-dd')+1
            </isNotEqual>
        </dynamic>
        <dynamic>
            <isNotEqual  property="type" >
                type = #type#
            </isNotEqual>
        </dynamic>
        <dynamic>
            <isNotEqual  property="latn_id" >
                latn_id= #latn_id#
            </isNotEqual>
        </dynamic>
	</select>

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧