package top.lvzhiqiang.mapper;
import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import top.lvzhiqiang.entity.CoinApiConfig;
import java.util.List;
/**
* coin-API-配置Mapper
*
* @author lvzhiqiang
* 2023/9/9 17:37
*/
public interface CoinApiConfigMapper {
/**
* 删除所有
*/
@Delete("DELETE FROM coin_api_config")
void deleteAll();
/**
* 批量新增
*
* @param coinApiConfigList
*/
@Insert({""})
void insertList(List coinApiConfigList);
/**
* 查询所有
*/
@Select("SELECT * FROM coin_api_config WHERE delete_flag = 1")
List findAll();
/**
* 根据codeDesc模糊查询
*/
@Select({""})
List findByParams(String nameCn, String url, Integer type, Integer type2, Integer status);
@Select("SELECT M.trackCategory " +
"FROM (SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(cw.track_category, ',', B.HELP_TOPIC_ID + 1), ',', - 1) AS trackCategory " +
" FROM coin_watchlist cw " +
" JOIN MYSQL.HELP_TOPIC B " +
" ON B.HELP_TOPIC_ID < (LENGTH(cw.track_category) - LENGTH(REPLACE(cw.track_category, ',', '')) + 1)) M " +
"GROUP BY M.trackCategory " +
"ORDER BY COUNT(M.trackCategory) DESC")
List findTrackCategoryList();
@Select("select style_name from coin_color_style where delete_flag = 1")
List findColorStyleList();
@Select("select id,category_name categoryName from file_image_category where delete_flag = 1")
List findFileImageCategoryList();
@Select("select id,category_name categoryName from file_music_collection_category where delete_flag = 1")
List findFileMusicCategoryList();
@Select("select id,category_name categoryName from coin_exchange_category where delete_flag = 1")
List findFileCurrentHoldingCategoryList();
}