//修改
public int updateProvider( SmbmsProvider provider);
//查询范围
public List<SmbmsProvider> getProInData(String [] proCodes);
//查询范围
public List< SmbmsProvider> getProList(List<String> list);
//查询范围
public List< SmbmsProvider> getProbject (@Param( " proCodeList") List< SmbmsProvider> proCodeList , @Param(" proNameList") L ist< SmbmsProvider> proNameList) ;
<trim prefix="SET" suffixOverrides=",">
<!-- <set>-->
<if test="proCode!=null and proCode!=''">
proCode=#{proCode},
</if>
<if test="proName!=null and proName!=' '">
proName=#{proName},
</if>
<!-- </set>-->
</trim>
where id=#{id}
</update>
<select id="getProInData" resultType= " SmbmsProvider">
<!--select * from smbms_ provider where proCode in ( ? , ? )-->
select * from smbms_ provider
<if test=" array . length>8">
where proCode in
< !--collection代表参数类型 open代表开头 close代表结尾
separator每一项数据分割符item代表每一 项-->
<foreach collection= ”array" open="(" close=")" separator="," item=" proCode" >
#{proCode}
</foreach>
</if>
</select>
<select id= ”getProlist" resultType= ”SmbmsProvider" >
select * from smbms_ provider
<if test="list . size>8">
where proCode ir
<!--collection代表参数类型 open代表开头 close代表结尾
separator每一项数据分割符item代表每一 项-->
<foreach collection="list" open=" (" close=")" separator=", ”item=" proCode" >
#{proCode}
</foreach>
</if>
</select>
<select id="getPro0bject" resultType=" SmbmsProvider">
select * from smbms_ provider where proCode in
< !--collection代表参数类型
open代表开头close代表结尾
separator每一项数据分割符item代表每 项-->
<foreach collection="proCodeList" open="(" close=")" separator="," item= " provider">
#{provider. proCode}
</foreach>
and proName in
<foreach collection=" proNameList" open="(" close=")" separator="," item=" provider">
#{provider . proName}
</foreach>
</select>
' mapper>
SmbmsProvider provider=new SmbmsProvider();
provider . setId(18);
provider . setProCode("BJ_ GYS002" );
provider . setProName(”北京市海淀区五道口");
int count = mapper. updateProvider(provider);
sqlSession. commit( );
System. out . println(count);
}
@Test
public void getINPro( ){
ISmbmsProviderDao mapper = sq1Session . getMapper ( ISmbmsProviderDao.class);
String [] strs-new String[]{};
L ist< SmbmsProvider> porviderData = mapper . getProInData(strs);
for ( SmbmsProvider pro: porviderData){
System. out . print1n(pro . getProName());
}
@Test
public void getProList(){
ISmbmsProviderDao mapper = sqlSession. getMapper( ISmbmsProviderDao. class);
List<String> list=new ArrayList<>();
list . add("BJ_ GYS002");
list . add("BJ_ GYS001");
List<SmbmsProvider> porviderData = mapper . getProList(list);
for ( SmbmsProvider pro: porviderData)
System. out . println(pro . getProName());
}
@Test
public void getPro0bject(){
ISmbmsProviderDao mapper = sqlSession. getMapper ( ISmbmsProviderDao . class);
List<SmbmsProvider> list=new ArrayList<SmbmsProvider>();
SmbmsProvider provider=new SmbmsProvider( );
provider. setProCode("BJ_ GYS082" );
list. add(provider);
List< SmbmsProvider> list2=new ArrayList<~>();
SmbmsProvider provider2=new SmbmsProvider();
provider2. setProName( "北京纳福尔食用油有限公司”);
list2. add(provider2);
List< SmbmsProvider> porviderData = mapper . getPro0bject(list,list2);
for (SmbmsProvider pro:porviderData){
System. out . println(pro . getProName());
}