SimulationProjectMapper.xml 31 KB

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