SimulationManualProjectMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  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.SimulationManualProjectMapper">
  4. <!--添加-->
  5. <insert id="add" parameterType="api.common.pojo.po.project.SimulationManualProjectPO">
  6. insert into simulation_manual_project
  7. (id,
  8. project_date,
  9. project_num,
  10. project_id,
  11. project_name,
  12. project_describe,
  13. algorithm,
  14. algorithm_type,
  15. vehicle,
  16. scene,
  17. operation_cycle,
  18. parallelism,
  19. rule_view,
  20. is_choice_gpu,
  21. automatic_run_times,
  22. last_run_time,
  23. automatic_run_state,
  24. now_run_state,
  25. evaluation_level,
  26. start_time,
  27. finish_time,
  28. max_simulation_time,
  29. create_time,
  30. create_user_id,
  31. modify_time,
  32. modify_user_id,
  33. is_deleted,
  34. algorithm_array,
  35. vehicle_array,
  36. scene_array,
  37. details)
  38. values (#{id},
  39. #{projectDate,jdbcType=INTEGER},
  40. #{projectNum,jdbcType=INTEGER},
  41. #{projectId},
  42. #{projectName},
  43. #{projectDescribe},
  44. #{algorithm},
  45. #{algorithmType},
  46. #{vehicle},
  47. #{scene},
  48. #{operationCycle},
  49. #{parallelism},
  50. #{ruleView},
  51. #{isChoiceGpu},
  52. #{automaticRunTimes,jdbcType=BIGINT},
  53. #{lastRunTime},
  54. #{automaticRunState},
  55. #{nowRunState},
  56. #{evaluationLevel},
  57. #{startTime},
  58. #{finishTime},
  59. #{maxSimulationTime,jdbcType=BIGINT},
  60. #{createTime},
  61. #{createUserId},
  62. #{modifyTime},
  63. #{modifyUserId},
  64. #{isDeleted},
  65. #{algorithmArray},
  66. #{vehicleArray},
  67. #{sceneArray},
  68. #{details})
  69. </insert>
  70. <!--修改-->
  71. <update id="update" parameterType="api.common.pojo.po.project.SimulationManualProjectPO">
  72. update simulation_manual_project
  73. set project_name = #{projectName},
  74. project_describe = #{projectDescribe},
  75. algorithm = #{algorithm},
  76. algorithm_type = #{algorithmType},
  77. vehicle = #{vehicle},
  78. scene = #{scene},
  79. max_simulation_time = #{maxSimulationTime,jdbcType=BIGINT},
  80. parallelism = #{parallelism},
  81. is_choice_gpu = #{isChoiceGpu},
  82. algorithm_array = #{algorithmArray},
  83. vehicle_array = #{vehicleArray},
  84. scene_array = #{sceneArray}
  85. where id = #{id}
  86. and is_deleted = '0'
  87. </update>
  88. <!--查询项目最新id-->
  89. <select id="selectLastProjectId" resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  90. select project_date, project_num, project_id
  91. from simulation_manual_project
  92. where project_date = #{nowRq,jdbcType=INTEGER}
  93. and is_deleted = '0'
  94. order by project_date desc, project_num desc limit 1
  95. </select>
  96. <!--查询项目列表-->
  97. <select id="selectProject" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  98. resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  99. select * from simulation_manual_project
  100. <where>
  101. is_deleted = '0'
  102. <if test="projectId != null and projectId != ''">
  103. and project_id like CONCAT('%',#{project_id},'%')
  104. </if>
  105. <if test="projectName != null and projectName != ''">
  106. and project_name like CONCAT('%',#{project_name},'%')
  107. </if>
  108. <if test="nowRunState != null and nowRunState != ''">
  109. and now_run_state = #{nowRunState}
  110. </if>
  111. <if test="evaluationLevel != null and evaluationLevel != ''">
  112. and evaluation_level = #{evaluationLevel}
  113. </if>
  114. <if test="createTimeStart != null">
  115. and create_time &gt;= #{createTimeStart}
  116. </if>
  117. <if test="createTimeEnd != null">
  118. and create_time &lt;= #{createTimeEnd}
  119. </if>
  120. <if test="finishTimeStart != null">
  121. and finish_time &gt;= #{finishTimeStart}
  122. </if>
  123. <if test="finishTimeEnd != null">
  124. and finish_time &lt;= #{finishTimeEnd}
  125. </if>
  126. <if test="isDeleted != null and isDeleted != ''">
  127. and is_deleted = #{isDeleted}
  128. </if>
  129. </where>
  130. order by project_date desc, project_num desc, modify_time desc
  131. </select>
  132. <!--查询项目列表-->
  133. <select id="selectProjectList" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  134. resultType="api.common.pojo.vo.project.SimulationManualProjectVO">
  135. select id,
  136. project_date,
  137. project_num,
  138. project_id,
  139. project_name,
  140. project_describe,
  141. algorithm,
  142. algorithm_type,
  143. vehicle,
  144. scene,
  145. operation_cycle,
  146. parallelism,
  147. rule_view,
  148. is_choice_gpu,
  149. automatic_run_times,
  150. last_run_time,
  151. automatic_run_state,
  152. now_run_state,
  153. error_message,
  154. evaluation_level,
  155. start_time,
  156. finish_time,
  157. max_simulation_time,
  158. algorithm_score,
  159. task_number,
  160. task_completed,
  161. create_time,
  162. create_user_id,
  163. modify_time,
  164. modify_user_id,
  165. is_deleted,
  166. algorithm_array,
  167. vehicle_array,
  168. scene_array
  169. from simulation_manual_project
  170. <where>
  171. is_deleted = '0'
  172. <if test="projectId != null and projectId != ''">
  173. and project_id like CONCAT('%',#{projectId},'%')
  174. </if>
  175. <if test="projectName != null and projectName != ''">
  176. and project_name like CONCAT('%',#{projectName},'%')
  177. </if>
  178. <if test="nowRunState != null and nowRunState != ''">
  179. and now_run_state = #{nowRunState}
  180. </if>
  181. <if test="evaluationLevel != null and evaluationLevel != ''">
  182. and evaluation_level = #{evaluationLevel}
  183. </if>
  184. <if test="createTimeStart != null">
  185. and create_time &gt;= #{createTimeStart}
  186. </if>
  187. <if test="createTimeEnd != null">
  188. and create_time &lt;= #{createTimeEnd}
  189. </if>
  190. <if test="finishTimeStart != null">
  191. and finish_time &gt;= #{finishTimeStart}
  192. </if>
  193. <if test="finishTimeEnd != null">
  194. and finish_time &lt;= #{finishTimeEnd}
  195. </if>
  196. <if test="isDeleted != null and isDeleted != ''">
  197. and is_deleted = #{isDeleted}
  198. </if>
  199. <if test="createUserId != null and createUserId != ''">
  200. and create_user_id = #{createUserId}
  201. </if>
  202. </where>
  203. order by project_date desc, project_num desc, modify_time desc
  204. </select>
  205. <!--根据id查询-->
  206. <select id="selectProjectById" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  207. resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  208. select id,
  209. project_date,
  210. project_num,
  211. project_id,
  212. project_name,
  213. project_describe,
  214. algorithm,
  215. algorithm_type,
  216. vehicle,
  217. scene,
  218. operation_cycle,
  219. parallelism,
  220. rule_view,
  221. is_choice_gpu,
  222. automatic_run_times,
  223. last_run_time,
  224. automatic_run_state,
  225. now_run_state,
  226. evaluation_level,
  227. start_time,
  228. finish_time,
  229. max_simulation_time,
  230. algorithm_score,
  231. task_number,
  232. task_completed,
  233. create_time,
  234. create_user_id,
  235. modify_time,
  236. modify_user_id,
  237. is_deleted,
  238. details,
  239. algorithm_array,
  240. vehicle_array,
  241. scene_array
  242. from simulation_manual_project
  243. where id = #{id}
  244. and is_deleted = '0'
  245. </select>
  246. <!--根据项目名查询工作信息-->
  247. <select id="selectProjectByName" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  248. resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  249. select *
  250. from simulation_manual_project
  251. where project_name = #{projectName}
  252. and is_deleted = '0'
  253. </select>
  254. <!--根据id查询基本信息-->
  255. <select id="selectProjectBaseById" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  256. resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  257. select id,
  258. algorithm,
  259. scene,
  260. algorithm_score,
  261. project_name,
  262. project_id,
  263. algorithm_type,
  264. evaluation_level,
  265. start_time
  266. from simulation_manual_project
  267. where is_deleted = '0'
  268. and id = #{id}
  269. </select>
  270. <!--删除-->
  271. <update id="deleteProject">
  272. update simulation_manual_project
  273. set is_deleted='1'
  274. where id in
  275. <foreach collection="array" open="(" separator="," close=")" item="id">
  276. #{id}
  277. </foreach>
  278. </update>
  279. <!--查询项目状态-->
  280. <select id="selectProjectNowRunState" resultType="api.common.pojo.po.project.SimulationManualProjectPO">
  281. select now_run_state
  282. from simulation_manual_project
  283. where
  284. is_deleted='0' and
  285. id in
  286. <foreach collection="array" open="(" separator="," close=")" item="id">
  287. #{id}
  288. </foreach>
  289. </select>
  290. <!--修改运行状态-->
  291. <update id="updateProjectNowRunState" parameterType="api.common.pojo.param.project.SimulationManualProjectParam">
  292. update simulation_manual_project
  293. <set>
  294. <if test="nowRunState != null and nowRunState != ''">
  295. now_run_state = #{nowRunState},
  296. </if>
  297. <if test="startTime != null">
  298. start_time=#{startTime},
  299. </if>
  300. <if test="finishTime != null">
  301. finish_time=#{finishTime},
  302. </if>
  303. </set>
  304. where id = #{id} and is_deleted = '0'
  305. </update>
  306. <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
  307. <select id="selectAlgorithmBaseInfoById" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  308. select id, algorithm_name, description,share from(
  309. select a.id, a.algorithm_name, a.description,a.share,a.modify_time
  310. from algorithm a
  311. where a.is_deleted = '0' and share='0'
  312. <if test="id != null and id != ''">
  313. and a.id = #{id}
  314. </if>
  315. <if test="createUserId != null and createUserId !=''">
  316. and create_user_id=#{createUserId}
  317. </if>
  318. <if test="uploadMode != null and uploadMode != ''">
  319. and upload_mode = #{uploadMode}
  320. </if>
  321. union select b.id, b.algorithm_name,b.description,b.share,b.modify_time
  322. from algorithm b
  323. where b.is_deleted = '0' and b.share='1'
  324. <if test="uploadMode != null and uploadMode != ''">
  325. and upload_mode = #{uploadMode}
  326. </if>
  327. )c order by c.share ,c.modify_time desc
  328. </select>
  329. <!--获取车辆基本信息-->
  330. <select id="selectVehicleBaseInfoById" parameterType="string" resultType="api.common.pojo.po.model.VehiclePO">
  331. select a.id, a.vehicle_name, a.description, a.vehicle_top_view,a.vehicle_front_view
  332. from model_vehicle a
  333. where is_deleted = '0'
  334. <if test="id != null and id != ''">
  335. and a.id = #{id}
  336. </if>
  337. </select>
  338. <!--获取车辆配置信息-->
  339. <select id="selectConfigVehicle" resultType="api.common.pojo.po.model.ConfigPO">
  340. select id, config_name, vehicle_id, description,share
  341. from model_config
  342. where is_deleted = '0'
  343. <if test="id != null and id != ''">
  344. and id = #{id}
  345. </if>
  346. <if test="createUserId != null and createUserId !=''">
  347. and create_user_id=#{createUserId}
  348. </if>
  349. </select>
  350. <!--获取车辆配置信息-->
  351. <select id="selectConfigVehicle2" resultType="api.common.pojo.po.model.ConfigPO">
  352. select id, config_name, vehicle_id, description,share from(
  353. select id, config_name, vehicle_id, description,share,modify_time
  354. from model_config
  355. where is_deleted = '0' and share='0'
  356. <if test="id != null and id != ''">
  357. and id = #{id}
  358. </if>
  359. <if test="createUserId != null and createUserId !=''">
  360. and create_user_id=#{createUserId}
  361. </if>
  362. union select id, config_name, vehicle_id, description,share,modify_time
  363. from model_config
  364. where is_deleted = '0' and share='1')c order by c.share ,c.modify_time desc
  365. </select>
  366. <!--查询车辆配置传感器信息-->
  367. <select id="selectConfigSensor" parameterType="string" resultType="api.common.pojo.po.model.ConfigSensorPO">
  368. select sensor_type
  369. from relation_config_sensor
  370. where is_deleted = '0'
  371. <if test="id != null and id != ''">
  372. and config_id = #{id}
  373. </if>
  374. group by sensor_type
  375. </select>
  376. <!--获取场景包基本信息-->
  377. <select id="selectScenePackageBaseById" resultType="api.common.pojo.po.scene.ScenePackagePO">
  378. select package_id,package_name, scene_num,share from(
  379. select a.package_id,a.package_name, a.scene_num,a.share,a.modify_time
  380. from scene_package a
  381. where a.share = '0' and a.is_deleted = '0' and is_unavailable = '0'
  382. <if test="packageId != null and packageId != ''">
  383. and a.package_id = #{packageId}
  384. </if>
  385. <if test="createUserId != null and createUserId !=''">
  386. and create_user_id=#{createUserId}
  387. </if>
  388. union select b.package_id,b.package_name, b.scene_num,b.share,b.modify_time
  389. from scene_package b where b.share = '1' and b.is_deleted = '0'
  390. ) c order by c.share ,c.modify_time desc
  391. </select>
  392. <!--根据id查询场景包信息-->
  393. <select id="selectScenePackageInfoById" parameterType="string" resultType="api.common.pojo.po.scene.ScenePackagePO">
  394. select a.package_id, a.package_name, a.scene_num
  395. from scene_package a
  396. where a.package_id = #{id}
  397. </select>
  398. <!--查询车辆与传感器关联信息-->
  399. <select id="selectVehicleSensor" parameterType="string" resultType="api.common.pojo.po.model.ConfigSensorPO">
  400. select sensor_id,
  401. sensor_type,
  402. config_id,
  403. sensor_x,
  404. sensor_y,
  405. sensor_z,
  406. sensor_h,
  407. sensor_p,
  408. sensor_r,
  409. sensor_port
  410. from relation_config_sensor
  411. where config_id = #{id}
  412. and is_deleted = '0'
  413. </select>
  414. <!--摄像头基本信息-->
  415. <select id="selectSensorCamera" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  416. select a.sensor_name, description as sensorDescription, share
  417. from model_sensor_camera a
  418. where a.id = #{id}
  419. </select>
  420. <!--完美传感器基本信息-->
  421. <select id="selectSensorOgt" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  422. select a.sensor_name, description as sensorDescription, share
  423. from model_sensor_ogt a
  424. where a.id = #{id}
  425. </select>
  426. <!--激光雷达基本信息-->
  427. <select id="selectSensorLidar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  428. select a.sensor_name, description as sensorDescription, share
  429. from model_sensor_lidar a
  430. where a.id = #{id}
  431. </select>
  432. <!--毫米波雷达基本信息-->
  433. <select id="selectSensorRadar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  434. select a.name as sensor_name, description as sensorDescription, share
  435. from model_sensor_radar a
  436. where a.id = #{id}
  437. </select>
  438. <!--gps基本信息-->
  439. <select id="selectSensorGps" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  440. select a.sensor_name, description as sensorDescription
  441. from model_sensor_gps a
  442. where a.id = #{id}
  443. </select>
  444. <!--查询交通事故场景信息-->
  445. <select id="selectSceneAccidentById" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  446. select scene_name
  447. from scene_accident
  448. where accident_id = #{id}
  449. </select>
  450. <!--查询自然场景信息-->
  451. <select id="selectSceneNatural" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  452. select natural_name
  453. from scene_natural
  454. where natural_id = #{id}
  455. </select>
  456. <!--查询泛化场景信息-->
  457. <select id="selectSceneGeneralDataById" parameterType="string"
  458. resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  459. select scene_id scene_name
  460. from scene_general_data
  461. where id = #{id}
  462. </select>
  463. <!--查询标准法规场景信息-->
  464. <select id="selectSceneStandardsRegulations" parameterType="string"
  465. resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  466. select scene_name
  467. from scene_standards_regulations
  468. where regulations_id = #{id}
  469. </select>
  470. <!--根据场景包id获取场景子集-->
  471. <select id="selectSubSceneByPid" parameterType="string"
  472. resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  473. select sublist_id,
  474. sublist_name,
  475. scene_num,
  476. weight,
  477. parent_id,
  478. scene_natural_ids,
  479. scene_traffic_ids,
  480. scene_statue_ids,
  481. scene_generalization_ids
  482. from scene_package_sublist
  483. where parent_id = #{id}
  484. order by seq
  485. </select>
  486. <!--获取指标信息-->
  487. <select id="selectsublistBySublistId" parameterType="string"
  488. resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  489. select sublist_id,
  490. sublist_name,
  491. scene_num,
  492. weight,
  493. parent_id,
  494. scene_natural_ids,
  495. scene_traffic_ids,
  496. scene_statue_ids,
  497. scene_generalization_ids
  498. from scene_package_sublist
  499. where sublist_id = #{id}
  500. </select>
  501. <!--获取场景包下指标信息-->
  502. <select id="selectSublistByRootId" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  503. resultType="api.common.pojo.vo.project.SublistScoreVo">
  504. select sub.sublist_id as id, sub.parent_id, sub.sublist_name, sub.scene_num, sub.package_and_rules
  505. from scene_package_sublist sub
  506. where sub.root_id = #{packageId}
  507. order by sub.seq
  508. </select>
  509. <!--查询场景包id下最后一级所有指标和场景-->
  510. <select id="selectSubListByPid" parameterType="string"
  511. resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  512. select sublist_id,
  513. parent_id,
  514. sublist_name,
  515. scene_num,
  516. scene_natural_ids,
  517. scene_traffic_ids,
  518. scene_statue_ids,
  519. scene_generalization_ids
  520. from scene_package_sublist
  521. where package_and_rules is not null
  522. and package_and_rules != ''
  523. and root_id = #{id}
  524. and is_deleted = '0'
  525. </select>
  526. <!--保存项目最后一级指标信息-->
  527. <insert id="insertSimulationMptLastTargetScorePo"
  528. parameterType="api.common.pojo.po.project.SimulationMptLastTargetScorePO">
  529. insert into simulation_mpt_last_target_score
  530. (id,
  531. p_id,
  532. target,
  533. create_time,
  534. create_user_id,
  535. modify_time,
  536. modify_user_id,
  537. is_deleted)
  538. values (#{id},
  539. #{pId},
  540. #{target},
  541. #{createTime},
  542. #{createUserId},
  543. #{modifyTime},
  544. #{modifyUserId},
  545. #{isDeleted})
  546. </insert>
  547. <!--保存第一级指标信息-->
  548. <insert id="insertSimulationMptFirstTargetScorePo"
  549. parameterType="api.common.pojo.po.project.SimulationMptFirstTargetScorePO">
  550. insert into simulation_mpt_first_target_score
  551. (id,
  552. p_id,
  553. target,
  554. create_time,
  555. create_user_id,
  556. modify_time,
  557. modify_user_id,
  558. is_deleted)
  559. values (#{id},
  560. #{pId},
  561. #{target},
  562. #{createTime},
  563. #{createUserId},
  564. #{modifyTime},
  565. #{modifyUserId},
  566. #{isDeleted})
  567. </insert>
  568. <!--获取人员信息-->
  569. <select id="selectUserById" resultType="api.common.pojo.vo.project.SystemUserVo">
  570. select *
  571. from system_user
  572. where id = #{id}
  573. </select>
  574. <!--查询所有指标得分-->
  575. <select id="selectSubScore" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  576. resultType="api.common.pojo.vo.project.SublistScoreVo">
  577. select sub.sublist_id as id,
  578. sub.parent_id,
  579. sub.sublist_name,
  580. sub.scene_num,
  581. fir.score as firScore,
  582. las.score as lasScore,
  583. sub.package_and_rules,
  584. las.not_standard_scene_num,
  585. las.score_explain
  586. from scene_package_sublist sub
  587. left JOIN simulation_mpt_first_target_score fir
  588. on fir.target = sub.sublist_id and fir.p_id = #{id}
  589. left JOIN simulation_mpt_last_target_score las
  590. on las.target = sub.sublist_id and las.p_id = #{id}
  591. where sub.root_id = #{packageId}
  592. and (fir.target is not null or las.target is not null)
  593. order by sub.seq
  594. </select>
  595. <!--查询所有指标得分-->
  596. <select id="selectSubScore2" parameterType="api.common.pojo.param.project.SimulationManualProjectParam"
  597. resultType="api.common.pojo.vo.project.SublistScoreVo">
  598. select sub.sublist_id as id,
  599. sub.parent_id,
  600. sub.sublist_name,
  601. sub.scene_num,
  602. fir.score as firScore,
  603. las.score as lasScore,
  604. sub.package_and_rules,
  605. las.error_scene_num,
  606. las.not_scored_scene_num,
  607. las.not_standard_scene_num,
  608. las.standard_scene_num,
  609. las.score_explain,
  610. fir.target as firTarget,
  611. las.target as lasTarget
  612. from scene_package_sublist sub
  613. left join simulation_mpt_first_target_score fir
  614. on fir.target = sub.sublist_id and fir.p_id = #{id}
  615. left join simulation_mpt_last_target_score las
  616. on las.target = sub.sublist_id and las.p_id = #{id}
  617. where sub.root_id = #{packageId}
  618. order by sub.seq
  619. </select>
  620. <!--运行项目状态-->
  621. <select id="selectRunProjectByState" parameterType="java.lang.String" resultType="java.util.Map">
  622. select count(1) num, temp.now_run_state nowRunState
  623. from (select now_run_state, create_user_id
  624. from simulation_manual_project t1
  625. where is_deleted = 0
  626. and t1.create_user_id = #{createUserId}
  627. union all
  628. select now_run_state, create_user_id
  629. from simulation_automatic_subproject t2
  630. where is_deleted = 0
  631. and t2.create_user_id = #{createUserId}) temp
  632. group by temp.now_run_state
  633. </select>
  634. <!--评测等级分布-->
  635. <select id="selectEvaluationLevel" parameterType="java.util.Map" resultType="java.util.Map">
  636. select count(evaluation_level) num,evaluation_level evaluationLevel from simulation_manual_project
  637. where
  638. is_deleted = '0' and evaluation_level is not null
  639. <if test="createUserId != null and createUserId != ''">
  640. and create_user_id = #{createUserId}
  641. </if>
  642. group by evaluation_level
  643. </select>
  644. <!--添加第三方算法信息到算发表-->
  645. <insert id="insertOtherAlgorithm" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
  646. insert into algorithm
  647. (id,
  648. algorithm_name,
  649. upload_mode,
  650. is_deleted)
  651. values (id = #{id},
  652. algorithm_name = #{algorithmName},
  653. upload_mode = #{uploadMode},
  654. is_deleted = #{isDeleted})
  655. </insert>
  656. <!--更新第三方算法信息到算法表-->
  657. <update id="updateOtherAlgorithm" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
  658. update algorithm
  659. set algorithm_name=#{algorithmName}
  660. where id = #{id}
  661. and is_deleted = '0'
  662. </update>
  663. <!--查询第三方算法信息是否已经存在-->
  664. <select id="selectAlgorithmByQuery" parameterType="api.common.pojo.po.algorithm.AlgorithmPO"
  665. resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  666. select id, algorithm_name
  667. from algorithm
  668. where id = #{id}
  669. and is_deleted = '0'
  670. </select>
  671. <!--根据算法id获取最新的一条报告id-->
  672. <select id="selectLastProjectIdByAlgorithmId" resultType="java.lang.String">
  673. select id
  674. from (select id, finish_time
  675. from simulation_manual_project
  676. where algorithm = #{algorithmId}
  677. and is_deleted = '0'
  678. and now_run_state = '30'
  679. union all
  680. select sas.id, sas.finish_time
  681. from simulation_automatic_subproject sas
  682. left join simulation_automatic_project sap on sas.parent_id = sap.id
  683. where algorithm = #{algorithmId}
  684. and sas.is_deleted = '0'
  685. and sap.is_deleted = '0'
  686. and now_run_state = '30') temp
  687. order by finish_time desc limit 1
  688. </select>
  689. <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
  690. <select id="selectAlgorithmBaseInfoByIdSy" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  691. select id, algorithm_name, description,share,modify_time
  692. from algorithm
  693. where is_deleted = '0' and share='0'
  694. <if test="id != null and id != ''">
  695. and id = #{id}
  696. </if>
  697. <if test="createUserId != null and createUserId !=''">
  698. and create_user_id=#{createUserId}
  699. </if>
  700. <if test="uploadMode != null and uploadMode != ''">
  701. and upload_mode = #{uploadMode}
  702. </if>
  703. order by modify_time desc
  704. </select>
  705. <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
  706. <select id="selectAlgorithmBaseInfoByIdGy" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  707. select id, algorithm_name,description,share,modify_time
  708. from algorithm
  709. where is_deleted = '0' and share='1'
  710. <if test="uploadMode != null and uploadMode != ''">
  711. and upload_mode = #{uploadMode}
  712. </if>
  713. order by modify_time desc
  714. </select>
  715. <!--获取车辆配置信息-->
  716. <select id="selectConfigVehicleGy" resultType="api.common.pojo.po.model.ConfigPO">
  717. select a.id, a.config_name, a.vehicle_id, a.description, a.share, a.modify_time
  718. from model_config a
  719. left join model_vehicle b on a.vehicle_id = b.id
  720. where a.is_deleted = '0'
  721. and a.is_unavailable = '0'
  722. and a.share = '1'
  723. and b.is_deleted = '0'
  724. order by a.modify_time desc
  725. </select>
  726. <select id="selectConfigVehicleSy" resultType="api.common.pojo.po.model.ConfigPO">
  727. select a.id, a.config_name, a.vehicle_id, a.description,a.share,a.modify_time
  728. from model_config a left join model_vehicle b on a.vehicle_id=b.id
  729. where a.is_deleted = '0' and a.is_unavailable = '0' and a.share='0' and b.is_deleted='0'
  730. <if test="id != null and id != ''">
  731. and a.id = #{id}
  732. </if>
  733. <if test="createUserId != null and createUserId !=''">
  734. and a.create_user_id=#{createUserId}
  735. </if>
  736. order by a.modify_time desc
  737. </select>
  738. <!--获取场景包基本信息-->
  739. <select id="selectScenePackageBaseByIdGy" resultType="api.common.pojo.po.scene.ScenePackagePO">
  740. select package_id, package_name, scene_num, share, modify_time
  741. from scene_package
  742. where share = '1'
  743. and is_deleted = '0'
  744. and is_unavailable = '0'
  745. order by modify_time desc
  746. </select>
  747. <!--获取场景包基本信息-->
  748. <select id="selectScenePackageBaseByIdSy" resultType="api.common.pojo.po.scene.ScenePackagePO">
  749. select package_id,package_name, scene_num,share,modify_time
  750. from scene_package
  751. where share = '0' and is_deleted = '0' and is_unavailable = '0'
  752. <if test="packageId != null and packageId != ''">
  753. and package_id = #{packageId}
  754. </if>
  755. <if test="createUserId != null and createUserId !=''">
  756. and create_user_id=#{createUserId}
  757. </if>
  758. order by modify_time desc
  759. </select>
  760. <select id="selectAlgorithmTypeById" resultType="java.lang.String">
  761. select algorithm_type from simulation.simulation_manual_project where id = #{id}
  762. </select>
  763. <select id="selectAlgorithmById" resultType="java.lang.String">
  764. select algorithm from simulation.simulation_manual_project where id = #{id}
  765. </select>
  766. </mapper>