SimulationProjectMapper.xml 29 KB

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