SceneComplexityMapper.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.SceneComplexityMapper">
  4. <select id="selectSceneIdsByEvaluation" parameterType="api.common.pojo.po.scene.SceneComplexityPO"
  5. resultType="api.common.pojo.po.scene.SceneComplexityPO">
  6. SELECT
  7. *
  8. FROM
  9. (
  10. SELECT
  11. DISTINCT(scene_id),
  12. complexity,
  13. complexity_level,
  14. create_time
  15. FROM
  16. scene_complexity
  17. <where>
  18. is_deleted = '0'
  19. <if test="taskId != null and taskId != ''">
  20. AND task_id = #{taskId}
  21. </if>
  22. <if test="minComplexity != null and minComplexity != ''">
  23. AND complexity+0 >= #{minComplexity}
  24. </if>
  25. <if test="maxComplexity != null and maxComplexity != ''">
  26. AND complexity+0 &lt;= #{maxComplexity}
  27. </if>
  28. <if test="complexityLevels != null and complexityLevels.size()>0">
  29. AND complexity_level IN
  30. <foreach collection="complexityLevels" item="item" index="index"
  31. separator="," open="(" close=")">
  32. #{item}
  33. </foreach>
  34. </if>
  35. <if test="sceneIdList != null and sceneIdList.size()>0">
  36. AND scene_id IN
  37. <foreach collection="sceneIdList" item="item" index="index"
  38. separator="," open="(" close=")">
  39. #{item}
  40. </foreach>
  41. </if>
  42. </where>
  43. ORDER BY
  44. create_time DESC
  45. ) srlsc GROUP BY scene_id;
  46. </select>
  47. <select id="selectSceneComplexityEvaluationForExport" resultType="api.common.pojo.po.scene.SceneComplexityPO">
  48. SELECT
  49. scene_id, scene_type, task_id, complexity, complexity_level
  50. FROM scene_complexity
  51. <where>
  52. is_deleted = '0' AND task_id = #{taskId}
  53. <if test="list != null and list.size()>0">
  54. AND scene_id IN
  55. <foreach collection="list" item="item" index="index"
  56. separator="," open="(" close=")">
  57. #{item}
  58. </foreach>
  59. </if>
  60. </where>
  61. ORDER BY create_time DESC;
  62. </select>
  63. </mapper>