- select
- *
- from
- table
- where
- 1=1
- <if test="tUserId!=null and tUserId!=''">
- and t_user_id=#{tUserId}
- </if>
- <if test="toolCode!=null and toolCode!=''">
- and .tool_code=#{toolCode}
- </if>
- <if test="workCode!=null and workCode!=''">
- and work_code=#{workCode}
- </if>
- <if test="bDate!=null and bDate!=''">
- and b_date>#{bDate}
- </if>
来源: http://www.bubuko.com/infodetail-2673507.html