一. 使用insert操作时,需要获取返回值时:
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.vortex.cloud.zszy.prd.model.entity.hzyf.Event">
<insert/>
二. 使用 in 操作时, 需要使用 foreach 标签:
<if test="status != null">
and eventStatus in
<foreach collection="status" item="statu" index="index" open="(" close=")" separator=",">
</foreach>
</if>
三. 跨表查询时,同样是使用foreach标签
<select id="countByCriteriaWeb" parameterType="com.vortex.cloud.zszy.prd.model.criteria.hzyf.EventCriteria" resultType="java.lang.Integer">
<foreach item="item" collection="tbNames" open="" separator=" union all " close="">
select
count(id)
from ${item}
<include refid="Base_Where_web" />
<if test="depts != null">
and deptId in
<foreach collection="depts" item="dept" index="index" open="(" close=")" separator=",">
</foreach>
</if>
</foreach>
</select>