mybatis多条件查询
程序员文章站
2022-03-11 21:42:37
...
mapper:
List<Userapplicationform> queryUserapplication(Userapplicationform user);
mapper.xml:
<select id="queryUserapplication" resultMap="BaseResultMap" parameterType="com.zhiyu.pojo.Userapplicationform">
select * from userapplicationform
<where>
idfv=#{idfv}
<if test="status!=null"> and status=#{status} </if>
<if test="ipAddress!=null">and ipAddress=#{ipAddress}</if>
<if test="mobile!=null">and mobile=#{mobile}</if>
<if test="name!=null">and name=#{name}</if>
<if test="borroweofdate!=null">and borroweofdate=#{borroweofdate}</if>
<if test="repaymentdate!=null">and repaymentdate=#{repaymentdate}</if>
</where>
</select>
上一篇: [leetcode]344. 反转字符串
下一篇: mybatis实现条件查询