sql - Oracle query in Java Spring MVC does not work properly -


<select id="bbsmanagedao.selectbbsschdulmanagelist" parameterclass="boardvo" resultmap="schdulprogramlist"> <![cdata[ select ntt_id, bbs_id, ntt_no, ntt_sj, substr(ntt_cn,1,100) ntt_cn, category, frst_regist_pnttm, ntce_bgnde, ntce_endde ,field1, evn_end_date, field2, tell_no, use_at tn_bbs 1=1 , a.use_at = 'y' , ( bbs_id = 'education01_main' or bbs_id = 'course01_main' or bbs_id = 'feestival01_main' or bbs_id = 'reading01_main'     )  ]]> <isnotempty property="searchcondition2"> <isequal property="searchcondition2" comparevalue="daily" prepend="and"> <![cdata[ #searchsdate# >= field1 , #searchsdate# <= evn_end_date ]]> </isequal> isequal property="searchcondition2" comparevalue="week" prepend="and"> <![cdata[ (#searchbgnde# <= field1 , #searchendde# >= field1) or (#searchbgnde# <= evn_end_date , #searchendde# >= evn_end_date) or (#searchbgnde# >= field1 , #searchendde# <= evn_end_date) , use_at='y']]> </isequal> </isnotempty> <![cdata[     order field1 asc ]]> </select> 

this part of code inside of sql_oracle.xml

this query selecting articles of event if article fulfill condition(condition date).

i have 2 apis. 1 daily , other 1 weekly.

in daily query user send specific date(#searchsdate#) parameter , db search event going on day.

in weekly user send week give server start date of week , end date of week , send events going on week.

the problem though wrote

where 1=1   , a.use_at = 'y'   

when use week search send me events 'n' use_at data.
don't care if daily send me same data. don't
when added and use_at='y' end of week search worked.

but still don't know why maybe there error of ibatis grammer.

does know what's problem?

there issue query above. try modifying query or brakets around included in or comparison: below

( (#searchbgnde# <= field1 , #searchendde# >= field1)   or (#searchbgnde# <= evn_end_date , #searchendde# >= evn_end_date)   or (#searchbgnde# >= field1 , #searchendde# <= evn_end_date) )  , use_at='y' 

also sql_oracle.xml file has xml issue second isequal not tagged


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -