| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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({"<script>" +
- "INSERT INTO coin_api_config(name_cn, name_en, url, return_en, return_cn, type, type2, status, create_time, modify_time) " +
- "VALUES " +
- "<foreach collection='list' item='bac' index=\"index\" separator=\",\">" +
- " (#{bac.nameCn}, #{bac.nameEn}, #{bac.url}, #{bac.returnEn}, #{bac.returnCn}, #{bac.type}, #{bac.type2}, #{bac.status}, now(), now())" +
- " </foreach>" +
- "</script>"})
- void insertList(List<CoinApiConfig> coinApiConfigList);
- /**
- * 查询所有
- */
- @Select("SELECT * FROM coin_api_config WHERE delete_flag = 1")
- List<CoinApiConfig> findAll();
- /**
- * 根据codeDesc模糊查询
- */
- @Select({"<script>" +
- "select * from coin_api_config WHERE delete_flag = 1" +
- "<if test=\"nameCn != null and nameCn != ''\">" +
- " and name_cn like concat('%',#{nameCn},'%')" +
- "</if>" +
- "<if test=\"url != null and url != ''\">" +
- " and url like concat('%',#{url},'%')" +
- "</if>" +
- "<if test=\"type != null \">" +
- " and type = #{type}" +
- "</if>" +
- "<if test=\"type2 != null \">" +
- " and type2 = #{type2}" +
- "</if>" +
- "<if test=\"status != null \">" +
- " and status = #{status}" +
- "</if>" +
- " order by sort desc" +
- "</script>"})
- List<CoinApiConfig> 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<String> findTrackCategoryList();
- @Select("select style_name from coin_color_style where delete_flag = 1")
- List<String> findColorStyleList();
- @Select("select id,category_name categoryName from file_image_category where delete_flag = 1")
- List<JSONObject> findFileImageCategoryList();
- @Select("select id,category_name categoryName from file_music_collection_category where delete_flag = 1")
- List<JSONObject> findFileMusicCategoryList();
- @Select("select id,category_name categoryName from coin_exchange_category where delete_flag = 1")
- List<JSONObject> findFileCurrentHoldingCategoryList();
- }
|