import com.vci.PlatformWebApplication; import com.vci.corba.omd.data.BusinessObject; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.wrapper.VciQueryWrapperForDO; import com.vci.web.service.WebBoServiceI; import com.vci.web.util.WebUtil; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Description * @Author dangsn * @Date 2024/12/3 17:28 */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = PlatformWebApplication.class)//应用的主程序 public class BoServiceTest { @Resource private WebBoServiceI boServiceI; @Test public void test(){ String sql = "select * from pbt_part where oid = 'E2ADEE0E-20F9-4CE2-A904-114460B01EB7'"; //List list = boServiceI.queryByOnlySql(sql); //List list = boServiceI.queryByOnlySqlForObj(sql, PartDO.class); Map conditonMap = new HashMap<>(); conditonMap.put("oid", "E2ADEE0E-20F9-4CE2-A904-114460B01EB7"); List list = boServiceI.queryObject(PartDO.class, conditonMap); //DataGrid dataGrid = boServiceI.queryGridByBo("part", conditonMap); //DataGrid dataGrid = boServiceI.queryGridClass(PartDO.class, conditonMap); //VciQueryWrapperForDO wrapper = new VciQueryWrapperForDO(conditonMap, PartDO.class); //List list = boServiceI.selectByQueryWrapper(wrapper, PartDO.class); System.out.println(WebUtil.getJSONStringWithDateFormat(list)); } }