select id=getStaffs resultType=comaaamodelStaff SELECT staffstaffid staffstaffname staffidcard staffaddress staffphone staffentrytime branchbranchname
要让查询结果只显示state为1的数据,可以在
<where>
<if test="staffname!=null and staffname.length!=0">
staff.staffname LIKE CONCAT('%', #{staffname}, '%')
</if>
<if test="branchname!=null and branchname.length!=0">
branch.branchname LIKE CONCAT('%', #{branchname}, '%')
</if>
<if test="deptname!=null and deptname.length!=0">
department.deptname LIKE CONCAT('%', #{deptname}, '%')
</if>
<if test="state!=null and state==1">
AND staff.state = 1
</if>
</where>
在
这样就可以限制查询结果只显示state为1的数据。
原文地址: https://www.cveoy.top/t/topic/jbRo 著作权归作者所有。请勿转载和采集!