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>

posted on 2022-06-22 11:53  zyp_java_net  阅读(208)  评论(0编辑  收藏  举报

导航