<select id="findAllList" resultType="">
SELECT
<include refid=""/>
,b.organname as "organname",c.name as "name"
FROM 表名 a,表名 b,表名 c
<include refid=""/>
<where>
a.invalid = '0' and a.organcode = b.organcode and a.create_by = c.user_id
<if test="organcode != null and organcode != '' ">
and a.organcode = #{organcode}
</if>
<if test="assessDate !=null and assessDate != '' ">
and a.assess_date = #{assessDate}
</if>
and a.create_by = #{createBy}
</where>
order by a.create_date desc
</select>
xml中sql语句根据传入值动态增加查询条件
最新推荐文章于 2024-04-27 16:36:51 发布