1.接口方法
int queryByCondition(int flag, String dept);
写法一 <if test="param1==0"> and ur.xxx= 1000000 </if>
and u.STATUS = 1 AND net_code=#{1};
写法二:
int queryByCondition(@Param("flag") int flag, @Param("dept") String dept)
<if test="flag==0"> and ur.xxx= 1000000 </if>
and u.STATUS = 1 AND net_code=#{dept};
写法三 使用map
map.put("flag", 1);
map.put("dept","xx");
int queryByCondition(Map<Sring, Object> map) ;
<if test="flag==0"> and ur.xxx= 1000000 </if>
and u.STATUS = 1 AND net_code=#{dept};
写法四:通过对象实现