SimulationManualProjectMapper.xml 32 KB

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