SimulationProjectMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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. (
  8. id,
  9. project_date,
  10. project_num,
  11. project_id,
  12. project_name,
  13. project_describe,
  14. algorithm,
  15. algorithm_type,
  16. vehicle,
  17. scene,
  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. finish_time,
  28. max_simulation_time,
  29. create_time,
  30. create_user_id,
  31. modify_time,
  32. modify_user_id,
  33. is_deleted
  34. )
  35. values
  36. (
  37. #{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. #{finishTime,jdbcType=TIMESTAMP},
  57. #{maxSimulationTime,jdbcType=BIGINT},
  58. #{createTime,jdbcType=TIMESTAMP},
  59. #{createUserId,jdbcType=VARCHAR},
  60. #{modifyTime,jdbcType=TIMESTAMP},
  61. #{modifyUserId,jdbcType=VARCHAR},
  62. #{isDeleted,jdbcType=VARCHAR}
  63. )
  64. </insert>
  65. <!--修改-->
  66. <update id="update" parameterType="api.common.pojo.po.project.SimulationManualProjectPo">
  67. update simulation_manual_project
  68. set
  69. project_name = #{projectName,jdbcType=VARCHAR},
  70. project_describe = #{projectDescribe,jdbcType=VARCHAR},
  71. algorithm = #{algorithm,jdbcType=VARCHAR},
  72. algorithm_type = #{algorithmType,jdbcType=VARCHAR},
  73. vehicle = #{vehicle,jdbcType=VARCHAR},
  74. scene = #{scene,jdbcType=VARCHAR},
  75. max_simulation_time = #{maxSimulationTime,jdbcType=BIGINT},
  76. parallelism = #{parallelism,jdbcType=VARCHAR},
  77. is_choice_gpu = #{isChoiceGpu,jdbcType=VARCHAR}
  78. where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  79. </update>
  80. <!--查询项目最新id-->
  81. <select id="selectLastProjectId" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  82. select project_date, project_num, project_id
  83. from simulation_manual_project
  84. where project_date=#{nowRq,jdbcType=INTEGER} and is_deleted = '0'
  85. order by project_date desc, project_num desc
  86. limit 1
  87. </select>
  88. <!--查询项目列表-->
  89. <select id="selectProject" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  90. select * from simulation_manual_project
  91. <where>
  92. is_deleted = '0'
  93. <if test="projectId != null and projectId != ''">
  94. and project_id like CONCAT('%',#{project_id,jdbcType=VARCHAR},'%')
  95. </if>
  96. <if test="projectName != null and projectName != ''">
  97. and project_name like CONCAT('%',#{project_name,jdbcType=VARCHAR},'%')
  98. </if>
  99. <if test="nowRunState != null and nowRunState != ''">
  100. and now_run_state = #{nowRunState}
  101. </if>
  102. <if test="evaluationLevel != null and evaluationLevel != ''">
  103. and evaluation_level = #{evaluationLevel}
  104. </if>
  105. <if test="createTimeStart != null">
  106. and create_time &gt;= #{createTimeStart,jdbcType=TIMESTAMP}
  107. </if>
  108. <if test="createTimeEnd != null">
  109. and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
  110. </if>
  111. <if test="finishTimeStart != null">
  112. and finish_time &gt;= #{finishTimeStart,jdbcType=TIMESTAMP}
  113. </if>
  114. <if test="finishTimeEnd != null">
  115. and finish_time &lt;= #{finishTimeEnd,jdbcType=TIMESTAMP}
  116. </if>
  117. <if test="isDeleted != null and isDeleted != ''">
  118. and is_deleted = #{isDeleted,jdbcType=VARCHAR}
  119. </if>
  120. </where>
  121. order by project_date desc, project_num desc, modify_time desc
  122. </select>
  123. <!--查询项目列表-->
  124. <select id="selectProjectList" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SimulationManualProjectVo">
  125. select * from simulation_manual_project
  126. <where>
  127. is_deleted = '0'
  128. <if test="projectId != null and projectId != ''">
  129. and project_id like CONCAT('%',#{projectId,jdbcType=VARCHAR},'%')
  130. </if>
  131. <if test="projectName != null and projectName != ''">
  132. and project_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
  133. </if>
  134. <if test="nowRunState != null and nowRunState != ''">
  135. and now_run_state = #{nowRunState}
  136. </if>
  137. <if test="evaluationLevel != null and evaluationLevel != ''">
  138. and evaluation_level = #{evaluationLevel}
  139. </if>
  140. <if test="createTimeStart != null">
  141. and create_time &gt;= #{createTimeStart,jdbcType=TIMESTAMP}
  142. </if>
  143. <if test="createTimeEnd != null">
  144. and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
  145. </if>
  146. <if test="finishTimeStart != null">
  147. and finish_time &gt;= #{finishTimeStart,jdbcType=TIMESTAMP}
  148. </if>
  149. <if test="finishTimeEnd != null">
  150. and finish_time &lt;= #{finishTimeEnd,jdbcType=TIMESTAMP}
  151. </if>
  152. <if test="isDeleted != null and isDeleted != ''">
  153. and is_deleted = #{isDeleted,jdbcType=VARCHAR}
  154. </if>
  155. </where>
  156. order by project_date desc, project_num desc, modify_time desc
  157. </select>
  158. <!--根据id查询-->
  159. <select id="selectProjectById" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  160. select * from simulation_manual_project where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  161. </select>
  162. <!--根据项目名查询工作信息-->
  163. <select id="selectProjectByName" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  164. select *
  165. from simulation_manual_project
  166. where project_name = #{projectName,jdbcType=VARCHAR} and is_deleted = '0'
  167. </select>
  168. <!--根据id查询基本信息-->
  169. <select id="selectProjectBaseById" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  170. select id,algorithm,scene,algorithm_score,project_name,project_id
  171. from simulation_manual_project where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  172. </select>
  173. <!--删除-->
  174. <update id="deleteProject">
  175. update simulation_manual_project
  176. set is_deleted='1'
  177. where id in
  178. <foreach collection="array" open="(" separator="," close=")" item="id">
  179. #{id,jdbcType=VARCHAR}
  180. </foreach>
  181. </update>
  182. <!--查询项目状态-->
  183. <select id="selectProjectNowRunState" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  184. select now_run_state
  185. from simulation_manual_project
  186. where
  187. is_deleted='0' and
  188. id in
  189. <foreach collection="array" open="(" separator="," close=")" item="id">
  190. #{id,jdbcType=VARCHAR}
  191. </foreach>
  192. </select>
  193. <!--修改运行状态-->
  194. <update id="updateProjectNowRunState" parameterType="api.common.pojo.param.project.SimulationManualProjectParam">
  195. update simulation_manual_project
  196. <set>
  197. <if test="nowRunState != null and nowRunState != ''">
  198. now_run_state = #{nowRunState,jdbcType=VARCHAR},
  199. </if>
  200. <if test="startTime != null">
  201. start_time=#{startTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="finishTime != null">
  204. finish_time=#{finishTime,jdbcType=TIMESTAMP},
  205. </if>
  206. </set>
  207. where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  208. </update>
  209. <!--获取算法基本信息 /*where a.share = '0' and a.is_deleted = '0'*/-->
  210. <select id="selectAlgorithmBaseInfoById" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  211. select a.id, a.algorithm_name, a.description
  212. from algorithm a
  213. where a.share = '0' and a.is_deleted = '0'
  214. <if test="id != null and id != ''">
  215. and a.id = #{id,jdbcType=VARCHAR}
  216. </if>
  217. <if test="createUserId != null and createUserId !=''">
  218. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  219. </if>
  220. </select>
  221. <!--获取车辆基本信息-->
  222. <select id="selectVehicleBaseInfoById" parameterType="string" resultType="api.common.pojo.po.model.VehiclePO">
  223. select a.id, a.vehicle_name, a.description, a.vehicle_top_view
  224. from model_vehicle a
  225. where is_deleted = '0'
  226. <if test="id != null and id != ''">
  227. and a.id = #{id,jdbcType=VARCHAR}
  228. </if>
  229. </select>
  230. <!--获取车辆配置信息-->
  231. <select id="selectConfigVehicle" resultType="api.common.pojo.po.model.ConfigPO">
  232. select id, config_name, vehicle_id, description
  233. from model_config
  234. where share = '0' and is_deleted = '0'
  235. <if test="id != null and id != ''">
  236. and id = #{id,jdbcType=VARCHAR}
  237. </if>
  238. <if test="createUserId != null and createUserId !=''">
  239. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  240. </if>
  241. </select>
  242. <!--查询车辆配置传感器信息-->
  243. <select id="selectConfigSensor" parameterType="string" resultType="api.common.pojo.po.model.ConfigSensorPO">
  244. select sensor_type
  245. from relation_config_sensor
  246. where is_deleted = '0'
  247. <if test="id != null and id != ''">
  248. and config_id = #{id,jdbcType=VARCHAR}
  249. </if>
  250. group by sensor_type
  251. </select>
  252. <!--获取场景包基本信息-->
  253. <select id="selectScenePackageBaseById" resultType="api.common.pojo.po.scene.ScenePackagePO">
  254. select a.package_id,a.package_name, a.scene_num
  255. from scene_package a
  256. where a.share = '0' and a.is_deleted = '0'
  257. <if test="packageId != null and packageId != ''">
  258. and a.package_id = #{packageId,jdbcType=VARCHAR}
  259. </if>
  260. <if test="createUserId != null and createUserId !=''">
  261. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  262. </if>
  263. </select>
  264. <!--查询车辆与传感器关联信息-->
  265. <select id="selectVehicleSensor" parameterType="string" resultType="api.common.pojo.po.model.ConfigSensorPO">
  266. select
  267. sensor_id,
  268. sensor_type,
  269. config_id,
  270. sensor_x,
  271. sensor_y,
  272. sensor_z,
  273. sensor_h,
  274. sensor_p,
  275. sensor_r,
  276. sensor_port
  277. from relation_config_sensor
  278. where config_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  279. </select>
  280. <!--摄像头基本信息-->
  281. <select id="selectSensorCamera" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  282. select a.sensor_name, description as sensorDescription
  283. from model_sensor_camera a
  284. where a.id = #{id,jdbcType=VARCHAR}
  285. </select>
  286. <!--完美传感器基本信息-->
  287. <select id="selectSensorOgt" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  288. select a.sensor_name, description as sensorDescription
  289. from model_sensor_ogt a
  290. where a.id = #{id,jdbcType=VARCHAR}
  291. </select>
  292. <!--激光雷达基本信息-->
  293. <select id="selectSensorLidar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  294. select a.sensor_name, description as sensorDescription
  295. from model_sensor_lidar a
  296. where a.id = #{id,jdbcType=VARCHAR}
  297. </select>
  298. <!--毫米波雷达基本信息-->
  299. <select id="selectSensorRadar" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  300. select a.name as sensor_name, description as sensorDescription
  301. from model_sensor_radar a
  302. where a.id = #{id,jdbcType=VARCHAR}
  303. </select>
  304. <!--gps基本信息-->
  305. <select id="selectSensorGps" parameterType="string" resultType="api.common.pojo.vo.project.SensorBaseInfoVo">
  306. select a.sensor_name, description as sensorDescription
  307. from model_sensor_gps a
  308. where a.id = #{id,jdbcType=VARCHAR}
  309. </select>
  310. <!--查询交通事故场景信息-->
  311. <select id="selectSceneAccidentById" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  312. select scene_name
  313. from scene_accident
  314. where accident_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  315. </select>
  316. <!--查询自然场景信息-->
  317. <select id="selectSceneNatural" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  318. select natural_name
  319. from scene_natural
  320. where natural_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  321. </select>
  322. <!--查询标准法规场景信息-->
  323. <select id="selectSceneStandardsRegulations" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
  324. select scene_name
  325. from scene_standards_regulations
  326. where regulations_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  327. </select>
  328. <!--根据场景包id获取场景子集-->
  329. <select id="selectSubSceneByPid" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  330. select sublist_id,sublist_name,scene_num,weight,parent_id,scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids
  331. from scene_package_sublist
  332. where parent_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  333. order by seq desc
  334. </select>
  335. <!--获取指标信息-->
  336. <select id="selectsublistBySublistId" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  337. select sublist_id,sublist_name,scene_num,weight,parent_id,scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids
  338. from scene_package_sublist
  339. where sublist_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  340. order by seq desc
  341. </select>
  342. <!--查询场景包id下最后一级所有指标和场景-->
  343. <select id="selectSubListByPid" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
  344. select
  345. sublist_id,
  346. parent_id,
  347. sublist_name,
  348. scene_num,
  349. scene_natural_ids,
  350. scene_traffic_ids,
  351. scene_statue_ids,
  352. scene_generalization_ids
  353. from scene_package_sublist
  354. where package_and_rules != null
  355. and package_and_rules != ''
  356. and root_id = #{id,jdbcType=VARCHAR}
  357. and is_deleted = '0'
  358. </select>
  359. <!--保存项目最后一级指标信息-->
  360. <insert id="insertSimulationMptLastTargetScorePo" parameterType="api.common.pojo.po.project.SimulationMptLastTargetScorePo">
  361. insert into simulation_mpt_last_target_score
  362. (
  363. id,
  364. p_id,
  365. target,
  366. create_time,
  367. create_user_id,
  368. modify_time,
  369. modify_user_id,
  370. is_deleted
  371. )
  372. values
  373. (
  374. #{id,jdbcType=VARCHAR}
  375. #{pId,jdbcType=VARCHAR}
  376. #{target,jdbcType=VARCHAR}
  377. #{createTime,jdbcType=TIMESTAMP},
  378. #{createUserId,jdbcType=VARCHAR},
  379. #{modifyTime,jdbcType=TIMESTAMP},
  380. #{modifyUserId,jdbcType=VARCHAR},
  381. #{isDeleted,jdbcType=VARCHAR}
  382. )
  383. </insert>
  384. <!--保存第一级指标信息-->
  385. <insert id="insertSimulationMptFirstTargetScorePo" parameterType="api.common.pojo.po.project.SimulationMptFirstTargetScorePo">
  386. insert into simulation_mpt_first_target_score
  387. (
  388. id,
  389. p_id,
  390. target,
  391. create_time,
  392. create_user_id,
  393. modify_time,
  394. modify_user_id,
  395. is_deleted
  396. )
  397. values
  398. (
  399. #{id,jdbcType=VARCHAR}
  400. #{pId,jdbcType=VARCHAR}
  401. #{target,jdbcType=VARCHAR}
  402. #{createTime,jdbcType=TIMESTAMP},
  403. #{createUserId,jdbcType=VARCHAR},
  404. #{modifyTime,jdbcType=TIMESTAMP},
  405. #{modifyUserId,jdbcType=VARCHAR},
  406. #{isDeleted,jdbcType=VARCHAR}
  407. )
  408. </insert>
  409. <!--查询场景得分-->
  410. <select id="selectSceneScore" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePo" resultType="api.common.pojo.po.project.SimulationMptSceneScorePo">
  411. select score, target_evaluate
  412. from simulation_mpt_scene_score
  413. where p_id = #{pId,jdbcType=VARCHAR} and is_deleted = '0'
  414. <if test="sceneId != null and sceneId != ''">
  415. and scene_id = #{sceneId,jdbcType=VARCHAR}
  416. </if>
  417. </select>
  418. <!--获取人员信息-->
  419. <select id="selectUserById" resultType="api.common.pojo.vo.project.SystemUserVo">
  420. select *
  421. from system_user
  422. where id = #{id,jdbcType=VARCHAR}
  423. </select>
  424. <!--查询所有指标得分-->
  425. <select id="selectSubScore" parameterType="string" resultType="api.common.pojo.vo.project.SublistScoreVo">
  426. select sub.sublist_id as id, sub.parent_id, sub.sublist_name,sub.scene_num,
  427. fir.score as firScore,las.score as lasScore, sub.package_and_rules, las.not_standard_scene_num, las.score_explain
  428. from scene_package_sublist sub
  429. left JOIN simulation_mpt_first_target_score fir on fir.target=sub.sublist_id
  430. left JOIN simulation_mpt_last_target_score las on las.target = sub.sublist_id
  431. where sub.root_id = #{id,jdbcType=VARCHAR} and sub.is_deleted='0'
  432. order by seq
  433. </select>
  434. <!--查询某天运行项目数量-->
  435. <select id="selectRunProjectBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
  436. select count(id) from simulation_manual_project
  437. where
  438. is_deleted = '0'
  439. <if test="createUserId != null and createUserId != ''">
  440. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  441. </if>
  442. <if test="startDate != null">
  443. and start_time &gt;= #{startDate}
  444. </if>
  445. <if test="endDate != null">
  446. and start_time &lt;= #{endDate}
  447. </if>
  448. </select>
  449. <!--运行项目状态-->
  450. <select id="selectRunProjectByState" parameterType="java.util.Map" resultType="java.util.Map">
  451. select count(now_run_state) num,now_run_state nowRunState from simulation_manual_project
  452. where
  453. is_deleted = '0'
  454. <if test="createUserId != null and createUserId != ''">
  455. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  456. </if>
  457. group by now_run_state
  458. </select>
  459. <!--评测等级分布-->
  460. <select id="selectEvaluationLevel" parameterType="java.util.Map" resultType="java.util.Map">
  461. select count(evaluation_level) num,evaluation_level evaluationLevel from simulation_manual_project
  462. where
  463. is_deleted = '0' and evaluation_level is not null
  464. <if test="createUserId != null and createUserId != ''">
  465. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  466. </if>
  467. group by evaluation_level
  468. </select>
  469. <!--添加第三方算法信息到算发表-->
  470. <insert id="insertOtherAlgorithm" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
  471. insert into algorithm
  472. (
  473. id,
  474. algorithm_name,
  475. upload_mode,
  476. is_deleted
  477. )
  478. values
  479. (
  480. id=#{id,jdbcType=VARCHAR},
  481. algorithm_name=#{algorithmName,jdbcType=VARCHAR},
  482. upload_mode=#{uploadMode,jdbcType=VARCHAR},
  483. is_deleted=#{isDeleted,jdbcType=VARCHAR},
  484. )
  485. </insert>
  486. <!--更新第三方算法信息到算法表-->
  487. <update id="updateOtherAlgorithm" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
  488. update algorithm
  489. set algorithm_name=#{algorithmName,jdbcType=VARCHAR}
  490. where id=#{id,jdbcType=VARCHAR}
  491. and is_deleted = '0'
  492. </update>
  493. <!--查询第三方算法信息是否已经存在-->
  494. <select id="selectalgorithmByQuery" parameterType="api.common.pojo.po.algorithm.AlgorithmPO" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
  495. select id, algorithmName
  496. from algorithm
  497. where id=#{id,jdbcType=VARCHAR}
  498. and is_deleted = '0'
  499. </select>
  500. <!--根据算法id获取最新的一条报告id-->
  501. <select id="selectProjectReportIdByAlgorithmId" parameterType="string" resultType="api.common.pojo.po.project.SimulationManualProjectPo">
  502. select id
  503. from simulation_manual_project
  504. where algorithm = #{algorithmId,jdbcType=VARCHAR} and is_deleted = '0' and now_run_state='30'
  505. order by finish_time desc
  506. limit 1
  507. </select>
  508. </mapper>