SimulationProjectMapper.xml 27 KB

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