mybatis里select写法 20

selectRESOURCE_ID"id",UP_RESOURCE_ID"upId",RESOURCE_CODE"rescCode",URL,TARGET,ICON,it... select RESOURCE_ID "id", UP_RESOURCE_ID "upId", RESOURCE_CODE "rescCode", URL,TARGET,ICON,itnlz.TITLE_CNTNT as TEXT from t_itnlz_text itnlz left join t_resource res on res.RESOURCE_ID=itnlz.TITLE_CD1 <include refid="resourceWhere" /> and itnlz.LNG_TP= #{lngTp} and itnlz.title_big_clss= #{titleBigClss} order by res.seq_num没有include后面的条件,就可以查出来,有这个条件为啥就查不出来了,后面的条件该怎么加上去啊?求救~ 展开
 我来答
zhang__琦
2016-07-29 · TA获得超过387个赞
知道答主
回答量:222
采纳率:0%
帮助的人:71.5万
展开全部
SELECT <include refid="columns"/>
FROM table
<include refid="dynamicWhere" />
<if test="@Ognl@isNotEmpty(orderField)">
order by ${orderField} ${orderSeq}
</if>
<if test="@Ognl@isEmpty(orderField)">
order by tableId desc
</if>
追问
我include  where语句后需要添加判断,也就是后面写的and itnlz.LNG_TP= #{lngTp} and itnlz.title_big_clss= #{titleBigClss} ,改怎么写呀,你写的那个是选择排序啊
追答
select  send.sendid sendid,
send.sender sender,
rece.receiveid rid,
red.ifRead
from
SYS_SENDNOTE send
left join SYS_NOTE_READ red on send.sendid=red.noteId and red.receiversId=#{receiversId} ,
sys_note_receive rece
where
send.sendid=rece.noteId
and (rece.receiversId in (select orgId from sys_user_org where userId = #{receiversId})
or rece.receiversId=#{receiversId}
)
AND send.subject LIKE #{subject,jdbcType=VARCHAR}
AND send.content LIKE #{content,jdbcType=VARCHAR}
AND red.ifRead is null
AND red.ifRead is not null

order by ${orderField} ${orderSeq}

order by send.sendtime desc
我下班了你看看这个
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式