<!--随便下面参数的其中一个都可以查询-->
<!-- <select id="selectBankInfo" resultMap="BaseResultMap" >
SELECT
bankHolderName,bankHolderStatus,bankAccountNum,bankName,branchName,branchAddress
from dms_master d
inner join dms_payment s
on d.accountId=s.accountId
<where>
<if test="keyword!=null and keyword!= ''">
or d.accountId= #{keyword}
</if>
<if test="keyword!=null and keyword!= ''">
or d.name= #{keyword}
</if>
<if test="keyword!=null and keyword!= ''">
or d.IDNum= #{keyword}
</if>
</where>
</select>-->
三选一
<select id="selectBankInfo" resultMap="BaseResultMap" >
SELECT
bankHolderName,bankHolderStatus,bankAccountNum,bankName,branchName,branchAddress
from dms_master d
inner join dms_payment s
on d.accountId=s.accountId
<where>
<choose>
<when test="accountid!=null and accountid!= ''">
and d.accountId= #{accountid}
</when>
<when test="name!=null and name!= ''">
and d.name= #{name}
</when>
<when test="idnum!=null and idnum!= ''">
and d.IDNum= #{idnum}
</when>
<otherwise>
and d.accountId= #{accountid}
</otherwise>
</choose>
</where>
</select>
三个都选
<select id="selectBankInfo" resultMap="BaseResultMap" >
SELECT
bankHolderName,bankHolderStatus,bankAccountNum,bankName,branchName,branchAddress
from dms_master d
inner join dms_payment s
on d.accountId=s.accountId
<where>
<iftest="accountid!=null and accountid!= ''">
and d.accountId= #{accountid}
</if>
<iftest="name!=null and name!= ''">
and d.name= #{name}
</if>
<iftest="idnum!=null and idnum!= ''">
and d.IDNum= #{idnum}
</if>
</where>
</select>