SimulationManualProjectMapper.xml 31 KB

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