ProviderMapper.xml
`<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.oupeng.mapper.ProviderMapper">
<!-- 当传的是一个参数(数组类型),collection="Array",这样写是没问题的,
当传多个参数时,mybatis不知道参数的对应位置,因此collection对应的值应该是参数名称,-->
<select id="getProviderBill" resultType="Bill">
select * from smbms_bill where providerId in
<foreach collection="providerId" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
`
ProviderMapper.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.oupeng.mapper.ProviderMapper">
<!-- -->
<select id="getProviderInfo" resultType="Provider">
select id,proCode,proName,proContact,creationDate from smbms_provider
<where>
<if test="proCode!=null">and proCode like concat('%',#{proCode},'%') </if>
<if test="proName!=null">and proName like concat('%',#{proName},'%')</if>
<if test="proContact!=null">and proContact like concat('%',#{proContact},'%')</if>
'endTime'>=creationDate and creationDate>='startTime'
</where>
</select>
</mapper>