1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.css.simulation.resource.server.infra.db.mysql.mapper.SceneComplexityMapper">
- <select id="selectSceneIdsByEvaluation" parameterType="api.common.pojo.po.scene.SceneComplexityPO"
- resultType="api.common.pojo.po.scene.SceneComplexityPO">
- SELECT
- *
- FROM
- (
- SELECT
- DISTINCT(scene_id),
- complexity,
- complexity_level,
- create_time
- FROM
- scene_complexity
- <where>
- is_deleted = '0'
- <if test="taskId != null and taskId != ''">
- AND task_id = #{taskId}
- </if>
- <if test="minComplexity != null and minComplexity != ''">
- AND complexity+0 >= #{minComplexity}
- </if>
- <if test="maxComplexity != null and maxComplexity != ''">
- AND complexity+0 <= #{maxComplexity}
- </if>
- <if test="complexityLevels != null and complexityLevels.size()>0">
- AND complexity_level IN
- <foreach collection="complexityLevels" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test="sceneIdList != null and sceneIdList.size()>0">
- AND scene_id IN
- <foreach collection="sceneIdList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY
- create_time DESC
- ) srlsc GROUP BY scene_id;
- </select>
- <select id="selectSceneComplexityEvaluationForExport" resultType="api.common.pojo.po.scene.SceneComplexityPO">
- SELECT
- scene_id, scene_type, task_id, complexity, complexity_level
- FROM scene_complexity
- <where>
- is_deleted = '0' AND task_id = #{taskId}
- <if test="list != null and list.size()>0">
- AND scene_id IN
- <foreach collection="list" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- </where>
- ORDER BY create_time DESC;
- </select>
- </mapper>
|