AlgorithmExpandMapper.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.server.infra.db.mysql.mapper.AlgorithmExpandMapper">
  4. <select id="select" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
  5. select id,
  6. algorithm_id algorithm_code,
  7. algorithm_name,
  8. description,
  9. algorithm_type,
  10. algorithm_version,
  11. team,
  12. topic,
  13. status
  14. from algorithm_expand
  15. where 1=1
  16. <if test="algorithmId != null and algorithmId != ''">
  17. and algorithm_id = #{algorithmId}
  18. </if>
  19. <if test="algorithmName != null and algorithmName != ''">
  20. and algorithm_name like concat('%',#{algorithmName},'%')
  21. </if>
  22. <if test="description != null and description != ''">
  23. and description like concat('%',#{description},'%')
  24. </if>
  25. <if test="algorithmVersion != null and algorithmVersion != ''">
  26. and algorithm_version like concat('%',#{algorithmVersion},'%')
  27. </if>
  28. <if test="team != null and team != ''">
  29. and team like concat('%',#{team},'%')
  30. </if>
  31. <if test="topic != null and topic != ''">
  32. and topic like concat('%',#{topic},'%')
  33. </if>
  34. <if test="status != null and status != ''">
  35. and status = #{status}
  36. </if>
  37. order by id desc
  38. </select>
  39. <select id="selectWithNoTeam" resultType="api.common.pojo.vo.algorithm.AlgorithmVO">
  40. select id,
  41. algorithm_id algorithm_code,
  42. algorithm_name,
  43. description,
  44. algorithm_type,
  45. algorithm_version,
  46. team,
  47. topic,
  48. status
  49. from algorithm_expand
  50. where team is null or team = ''
  51. <if test="algorithmName != null and algorithmName != ''">
  52. and algorithm_name like concat('%',#{algorithmName},'%')
  53. </if>
  54. <if test="description != null and description != ''">
  55. and description like concat('%',#{description},'%')
  56. </if>
  57. <if test="algorithmVersion != null and algorithmVersion != ''">
  58. and algorithm_version like concat('%',#{algorithmVersion},'%')
  59. </if>
  60. <if test="topic != null and topic != ''">
  61. and topic like concat('%',#{topic},'%')
  62. </if>
  63. <if test="status != null and status != ''">
  64. and status = #{status}
  65. </if>
  66. order by id desc
  67. </select>
  68. </mapper>