| | |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.ContentBuilder; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import com.highdatas.mdm.util.RedisClient; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.mybatis.spring.SqlSessionTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.sql.DataSource; |
| | | import java.sql.Connection; |
| | | import java.sql.SQLException; |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | IMaintainDetailService maintainDetailService; |
| | | @Autowired |
| | | IFlowsService flowsService; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | @Resource |
| | | protected DataSource dataSource; |
| | | |
| | |
| | | return maintain; |
| | | } |
| | | |
| | | |
| | | |
| | | //bak |
| | | public Result selectListByPage(String tableName, List<String> fieldList, String whereSegment, Integer pageNo, Integer pageSize, String version) { |
| | | Maintain maintainFromVersion = maintainService.getMaintainFromVersion(tableName, version); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result getFieldValByTable(String tableName, String field) { |
| | | //查缓存 |
| | | String key = DbUtils.getFieldRedisKey(tableName,field); |
| | | String redisVal = redisClient.getRedisVal(key); |
| | | if (!StringUtils.isEmpty(redisVal)) { |
| | | List<String> valList = DbUtils.split(redisVal); |
| | | if (valList != null) { |
| | | return Result.success(valList); |
| | | } |
| | | } |
| | | // 读数据库 |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Result getFieldValByMaintainField(String tableName, String field) { |
| | | //查缓存 |
| | | String key = DbUtils.getFieldRedisKey(tableName,field); |
| | | String redisVal = redisClient.getRedisVal(key); |
| | | if (!StringUtils.isEmpty(redisVal)) { |
| | | List<String> valList = DbUtils.split(redisVal); |
| | | if (valList != null) { |
| | | return Result.success(valList); |
| | | } |
| | | } |
| | | // 读数据库 |
| | | |
| | | return null; |
| | | } |
| | | } |