| | |
| | | import org.springblade.binlog.config.DataSourceConfig; |
| | | import org.springblade.binlog.vo.BinLogItem; |
| | | import org.springblade.binlog.vo.DataProperty; |
| | | import org.springblade.core.tool.utils.CollectionUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.sql.*; |
| | | import java.util.Arrays; |
| | |
| | | public class BinLogUtils { |
| | | |
| | | private static BinLogUtils binLogUtils; |
| | | |
| | | // @Resource |
| | | // private SearchStoreLogoExtMapper searchStoreLogoExtMapper; |
| | | |
| | | // @PostConstruct |
| | | // public void init() { |
| | | // binLogUtils = this; |
| | | // binLogUtils.searchStoreLogoExtMapper = this.searchStoreLogoExtMapper; |
| | | // } |
| | | |
| | | /** |
| | | * 拼接dbTable |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // /** |
| | | // * 根据table获取code |
| | | // * |
| | | // * @param table |
| | | // * @return java.lang.Integer |
| | | // */ |
| | | // public static Integer getCodeByTable(String table) { |
| | | // if (StringUtils.isEmpty(table)) { |
| | | // return null; |
| | | // } |
| | | // return CategoryEnum.getCodeByTab(table); |
| | | // } |
| | | |
| | | // public static String getMsgByTab(String table) { |
| | | // if (StringUtils.isEmpty(table)) { |
| | | // return null; |
| | | // } |
| | | // return CategoryEnum.getMsgByTab(table); |
| | | // } |
| | | |
| | | /** |
| | | * 根据DBTable获取table |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 根据storeId获取imgUrl |
| | | // */ |
| | | // public static String getImgUrl(Long storeId) { |
| | | // |
| | | // if (storeId == null) { |
| | | // return ""; |
| | | // } |
| | | // //获取url |
| | | // SearchStoreLogo searchStoreLogo = new SearchStoreLogo(); |
| | | // searchStoreLogo.setStoreId(storeId); |
| | | // List<SearchStoreLogo> searchStoreLogos = binLogUtils.searchStoreLogoExtMapper.selectList(searchStoreLogo); |
| | | // if (CollectionUtil.isNotEmpty(searchStoreLogos)) { |
| | | // SearchStoreLogo storeLogo = searchStoreLogos.get(0); |
| | | // if (storeLogo != null) { |
| | | // return storeLogo.getStoreLogo(); |
| | | // } |
| | | // } |
| | | // return ""; |
| | | // } |
| | | |
| | | /** |
| | | * 格式化date |
| | | * |
| | |
| | | Date formatDate = DateUtil.parse(strDate, dateFormat); |
| | | return formatDate; |
| | | } |
| | | |
| | | /** |
| | | * 格式化date |
| | | * |
| | | * @param date |
| | | * @return java.util.Date |
| | | */ |
| | | public static String getDateFormatStr(Date date) { |
| | | if (date == null) { |
| | | return null; |
| | | } |
| | | String dateFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | return DateUtil.format(date, dateFormat); |
| | | } |
| | | } |
| | | |
| | | |