其他分享
首页 > 其他分享> > mybatis foreach split

mybatis foreach split

作者:互联网

<!--  三管监测 -->
<select id="rep_sgjc" parameterType="JkHisZybrcryxxb" resultType="map">
select a.id,a.dqksmc,a.zyid,a.zycs,a.brxm,a.xb,a.ch,a.ryzd,date_format(a.ryrq,'%Y-%m-%d') ryrq, date_format(a.cyrq,'%Y-%m-%d') cyrq,b.yzxmmc from jk_his_zybrcryxxb a INNER JOIN jk_his_zybryzxxb b on
(b.yzxmmc like '%呼吸机%' or b.yzxmmc like '%静脉插管%'
or b.yzxmmc like '%留置导尿%') and a.zyid=b.zyid and a.zycs=b.zycs
<if test="dqksmc != null and dqksmc != ''"> and dqksmc like concat('%', #{dqksmc}, '%')</if>
<if test="params.beginRyrq != null and params.beginRyrq != '' and params.endRyrq != null and params.endRyrq != ''">
and ryrq between #{params.beginRyrq} and #{params.endRyrq}
</if>

<if test="yzxmmc != null and yzxmmc != ''">
AND b.yzxmmc LIKE
<foreach collection="yzxmmc.split(',')" open="(" separator="or" close=")" item="subscribeName">
CONCAT('%',trim(#{subscribeName}),'%')
</foreach>
</if>
</select>

标签:-%,zyid,like,ryrq,dqksmc,foreach,mybatis,yzxmmc,split
来源: https://www.cnblogs.com/zhyp/p/16400009.html