test_class.declarator: logService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private LogService logService;
test_class.type: LogService
test_class.var_name: logService
test_class.file: myth-admin/src/test/java/org/dromara/myth/admin/service/log/JdbcLogServiceImplTest.java
test_class.identifier: JdbcLogServiceImplTest
test_case.body: @Test
      public void listByPage() throws Exception {
          ConditionQuery query = new ConditionQuery();
  
          PageParameter pageParameter = new PageParameter(1, 10);
  
          query.setPageParameter(pageParameter);
          query.setApplicationName("account-service");
  
          final CommonPager<LogVO> pager = logService.listByPage(query);
  
          Assert.assertNotNull(pager.getDataList());
  
  
      }
test_case.class_method_signature: JdbcLogServiceImplTest.listByPage()
test_case.full_signature: @Test public void listByPage()
test_case.identifier: listByPage
test_case.invocations: setPageParameter setApplicationName listByPage assertNotNull getDataList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void listByPage()
focal_class.declarator: jdbcTemplate
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private JdbcTemplate jdbcTemplate;
focal_class.type: JdbcTemplate
focal_class.var_name: jdbcTemplate
focal_class.declarator: dbType
focal_class.modifier: private
focal_class.original_string: private String dbType;
focal_class.type: String
focal_class.var_name: dbType
focal_class.file: myth-admin/src/main/java/org/dromara/myth/admin/service/log/JdbcLogServiceImpl.java
focal_class.identifier: JdbcLogServiceImpl
focal_class.interfaces: implements LogService
focal_class.class_method_signature: JdbcLogServiceImpl.listByPage(final ConditionQuery query)
focal_class.full_signature: @Override public CommonPager<LogVO> listByPage(final ConditionQuery query)
focal_class.identifier: listByPage
focal_class.modifiers: @Override public
focal_class.parameters: (final ConditionQuery query)
focal_class.return: CommonPager<LogVO>
focal_class.signature: CommonPager<LogVO> listByPage(final ConditionQuery query)
focal_class.class_method_signature: JdbcLogServiceImpl.batchRemove(final List<String> ids, final String appName)
focal_class.full_signature: @Override public Boolean batchRemove(final List<String> ids, final String appName)
focal_class.identifier: batchRemove
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> ids, final String appName)
focal_class.return: Boolean
focal_class.signature: Boolean batchRemove(final List<String> ids, final String appName)
focal_class.class_method_signature: JdbcLogServiceImpl.updateRetry(final String id, final Integer retry, final String appName)
focal_class.full_signature: @Override public Boolean updateRetry(final String id, final Integer retry, final String appName)
focal_class.identifier: updateRetry
focal_class.modifiers: @Override public
focal_class.parameters: (final String id, final Integer retry, final String appName)
focal_class.return: Boolean
focal_class.signature: Boolean updateRetry(final String id, final Integer retry, final String appName)
focal_class.class_method_signature: JdbcLogServiceImpl.buildByMap(final Map<String, Object> map)
focal_class.full_signature: private LogVO buildByMap(final Map<String, Object> map)
focal_class.identifier: buildByMap
focal_class.modifiers: private
focal_class.parameters: (final Map<String, Object> map)
focal_class.return: LogVO
focal_class.signature: LogVO buildByMap(final Map<String, Object> map)
focal_class.class_method_signature: JdbcLogServiceImpl.setDbType(final String dbType)
focal_class.full_signature: public void setDbType(final String dbType)
focal_class.identifier: setDbType
focal_class.modifiers: public
focal_class.parameters: (final String dbType)
focal_class.return: void
focal_class.signature: void setDbType(final String dbType)
focal_class.class_method_signature: JdbcLogServiceImpl.buildPageSql(final String sql, final PageParameter pageParameter)
focal_class.full_signature: private String buildPageSql(final String sql, final PageParameter pageParameter)
focal_class.identifier: buildPageSql
focal_class.modifiers: private
focal_class.parameters: (final String sql, final PageParameter pageParameter)
focal_class.return: String
focal_class.signature: String buildPageSql(final String sql, final PageParameter pageParameter)
focal_class.class_method_signature: JdbcLogServiceImpl.buildDelSql(final String tableName, final String id)
focal_class.full_signature: private String buildDelSql(final String tableName, final String id)
focal_class.identifier: buildDelSql
focal_class.modifiers: private
focal_class.parameters: (final String tableName, final String id)
focal_class.return: String
focal_class.signature: String buildDelSql(final String tableName, final String id)
focal_method.body: @Override
      public CommonPager<LogVO> listByPage(final ConditionQuery query) {
          final String tableName = RepositoryPathUtils.buildDbTableName(query.getApplicationName());
          final PageParameter pageParameter = query.getPageParameter();
          StringBuilder sqlBuilder = new StringBuilder();
          sqlBuilder.append("select trans_id,target_class,target_method,"
                  + " retried_count,create_time,last_time,version,error_msg from ")
                  .append(tableName).append(" where 1= 1 ");
  
          if (StringUtils.isNoneBlank(query.getTransId())) {
              sqlBuilder.append(" and trans_id = ").append(query.getTransId());
          }
          final String sql = buildPageSql(sqlBuilder.toString(), pageParameter);
          CommonPager<LogVO> pager = new CommonPager<>();
          final List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
          if (CollectionUtils.isNotEmpty(mapList)) {
              pager.setDataList(mapList.stream().map(this::buildByMap).collect(Collectors.toList()));
          }
          final Integer totalCount =
                  jdbcTemplate.queryForObject(String.format("select count(1) from %s", tableName), Integer.class);
          pager.setPage(PageHelper.buildPage(pageParameter, totalCount));
          return pager;
      }
focal_method.class_method_signature: JdbcLogServiceImpl.listByPage(final ConditionQuery query)
focal_method.full_signature: @Override public CommonPager<LogVO> listByPage(final ConditionQuery query)
focal_method.identifier: listByPage
focal_method.invocations: buildDbTableName getApplicationName getPageParameter append append append isNoneBlank getTransId append append getTransId buildPageSql toString queryForList isNotEmpty setDataList collect map stream toList queryForObject format setPage buildPage
focal_method.modifiers: @Override public
focal_method.parameters: (final ConditionQuery query)
focal_method.return: CommonPager<LogVO>
focal_method.signature: CommonPager<LogVO> listByPage(final ConditionQuery query)