Intelligent label

1. ProviderDao layer

copy code
   //Smart label case

//Smart label multi-condition query
public List providerTest(@Param("proCode") String proCode, @Param("proName") String proName);
//Smart label to modify
public int updatePro(Provider provider);
//Query range (array)
public List getProInData(String [] proCodes);
//Query range (collection)
public List getProList(List list);
//Query range (multiple collections)
public List getProObject(@Param("proCodeList") List proCodeList,@Param("proNameList") List proNameList);
copy code

< p>Two, ProviderDao.xml small configuration file

copy code






update smbms_provider



proCode=#{proCode},


proName=#{proName},



where id=#{id}






copy code

Three, test class

copy code
public class providerTest {

SqlSession sqlSession=MybatisUtil.getSqlSession();
ProviderDao mapper = sqlSession.getMapper(ProviderDao.class);
//Smart label multi-condition query
@Test
public void getAllPro(){
List providers = mapper.providerTest("GZ", "Shenzhen");
for (Provider pro:providers) {
System.out.println(pro.getProName());
}
}
//Smart label to modify
@Test
public void updatePro(){
Provider provider=new Provider();
provider.setId(10);
provider.setProCode("JS_GYS012");
provider.setProName("Little Nanjing Fire Head Army Information Technology Co., Ltd.");
int count=mapper.updatePro(provider);
sqlSession.commit();
System.out.println(count);
}
//Query range (array)
@Test
public void getInPro(){
List providers = mapper.getProInData(new String[]{"BJ_GYS001","BJ_GYS002"});
for (Provider pro:providers) {
System.out.println(pro.getProName());
}
}
//Query range (collection)
@Test
public void getProList(){
List list=new ArrayList<>();
list.add("BJ_GYS002");
list.add("BJ_GYS001");
List providerData=mapper.getProList(list);
for (Provider pro:providerData) {
System.out.println(pro.getProName());
}
}
//Query range (multiple collections)
@Test
public void getProObject(){
List list =new ArrayList();
Provider provider=new Provider();
provider.setProCode("BJ_GYS002");
list.add(provider);

List list2 =new ArrayList();
Provider provider2=new Provider();
provider2.setProName("Beijing Nafore Edible Oil Co., Ltd.");
list2.add(provider2);
List providerData=mapper.getProObject(list,list2);
for (Provider pro:providerData) {
System.out.println(pro.getProName());
}
}
}
copy code

copy code
   //Smart label case

//Smart label multi-condition query
public List providerTest(@Param("proCode") String proCode, @Param("proName") String proName);
//Smart label to modify
public int updatePro(Provider provider);
//Query range (array)
public List getProInData(String [] proCodes);
//Query range (collection)
public List getProList(List list);
//Query range (multiple collections)
public List getProObject(@Param("proCodeList") List proCodeList,@Param("proNameList") List proNameList);
copy code

< p>copy code

copy code

copy code






update smbms_provider



proCode=#{proCode},


proName=#{proName},



where id=#{id}






copy code

copy code

copy code

copy code
public class providerTest {

SqlSession sqlSession=MybatisUtil.getSqlSession();
ProviderDao mapper = sqlSession.getMapper(ProviderDao.class);
//Smart label multi-condition query
@Test
public void getAllPro(){
List providers = mapper.providerTest("GZ", "Shenzhen");
for (Provider pro:providers) {
System.out.println(pro.getProName());
}
}
//Smart label to modify
@Test
public void updatePro(){
Provider provider=new Provider();
provider.setId(10);
provider.setProCode("JS_GYS012");
provider.setProName("Little Nanjing Fire Head Army Information Technology Co., Ltd.");
int count=mapper.updatePro(provider);
sqlSession.commit();
System.out.println(count);
}
//Query range (array)
@Test
public void getInPro(){
List providers = mapper.getProInData(new String[]{"BJ_GYS001","BJ_GYS002"});
for (Provider pro:providers) {
System.out.println(pro.getProName());
}
}
//Query range (collection)
@Test
public void getProList(){
List list=new ArrayList<>();
list.add("BJ_GYS002");
list.add("BJ_GYS001");
List providerData=mapper.getProList(list);
for (Provider pro:providerData) {
System.out.println(pro.getProName());
}
}
//Query range (multiple collections)
@Test
public void getProObject(){
List list =new ArrayList();
Provider provider=new Provider();
provider.setProCode("BJ_GYS002");
list.add(provider);

List list2 =new ArrayList();
Provider provider2=new Provider();
provider2.setProName("Beijing Nafore Edible Oil Co., Ltd.");
list2.add(provider2);
List providerData=mapper.getProObject(list,list2);
for (Provider pro:providerData) {
System.out.println(pro.getProName());
}
}
}
copy code

copy code

copy code

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 6064 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.