SimulationAutomaticProjectMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.SimulationAutomaticProjectMapper" >
  4. <!--根据id查询工作信息-->
  5. <select id="selectById" parameterType="string" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  6. select * from simulation_automatic_project where id=#{id,jdbcType=VARCHAR}
  7. </select>
  8. <!--根据条件查询工作信息-->
  9. <select id="selectAutomaticProjectByQuery" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  10. select * from simulation_automatic_project
  11. is_deleted = '0'
  12. <if test="projectName != null and projectName != ''">
  13. and project_name = #{projectName,jdbcType=VARCHAR}
  14. </if>
  15. </select>
  16. <!--查询最新项目id-->
  17. <select id="selectLastProjectId" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  18. select project_date, project_num, project_id
  19. from simulation_automatic_project
  20. where project_date=#{nowRq,jdbcType=INTEGER} and is_deleted = '0'
  21. order by project_date desc, project_num desc
  22. limit 1
  23. </select>
  24. <!--创建项目信息-->
  25. <insert id="add" parameterType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  26. insert into simulation_automatic_project
  27. (
  28. id,
  29. project_date,
  30. project_num,
  31. project_id,
  32. project_name,
  33. project_describe,
  34. algorithm,
  35. algorithm_type,
  36. vehicle,
  37. scene,
  38. operation_cycle,
  39. parallelism,
  40. rule_view,
  41. is_choice_gpu,
  42. automatic_run_times,
  43. last_run_time,
  44. automatic_run_state,
  45. create_time,
  46. create_user_id,
  47. modify_time,
  48. modify_user_id,
  49. is_deleted
  50. )
  51. values
  52. (
  53. #{id,jdbcType=VARCHAR},
  54. #{projectDate,jdbcType=INTEGER},
  55. #{projectNum,jdbcType=INTEGER},
  56. #{projectId,jdbcType=VARCHAR},
  57. #{projectName,jdbcType=VARCHAR},
  58. #{projectDescribe,jdbcType=VARCHAR},
  59. #{algorithm,jdbcType=VARCHAR},
  60. #{algorithmType,jdbcType=VARCHAR},
  61. #{vehicle,jdbcType=VARCHAR},
  62. #{scene,jdbcType=VARCHAR},
  63. #{operationCycle,jdbcType=VARCHAR},
  64. #{parallelism,jdbcType=VARCHAR},
  65. #{ruleView,jdbcType=VARCHAR},
  66. #{isChoiceGpu,jdbcType=VARCHAR},
  67. #{automaticRunTimes,jdbcType=BIGINT},
  68. #{lastRunTime,jdbcType=TIMESTAMP},
  69. #{automaticRunState,jdbcType=VARCHAR},
  70. #{createTime,jdbcType=TIMESTAMP},
  71. #{createUserId,jdbcType=VARCHAR},
  72. #{modifyTime,jdbcType=TIMESTAMP},
  73. #{modifyUserId,jdbcType=VARCHAR},
  74. #{isDeleted,jdbcType=VARCHAR}
  75. )
  76. </insert>
  77. <!--修改项目信息-->
  78. <update id="updateById" parameterType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  79. update simulation_automatic_project
  80. set
  81. project_name = #{projectName,jdbcType=VARCHAR},
  82. project_describe = #{projectDescribe,jdbcType=VARCHAR},
  83. algorithm = #{algorithm,jdbcType=VARCHAR},
  84. algorithm_type = #{algorithmType,jdbcType=VARCHAR},
  85. vehicle = #{vehicle,jdbcType=VARCHAR},
  86. scene = #{scene,jdbcType=VARCHAR},
  87. operation_cycle = #{operation_cycle,jdbcType=VARCHAR},
  88. parallelism = #{parallelism,jdbcType=VARCHAR},
  89. is_choice_gpu = #{isChoiceGpu,jdbcType=VARCHAR}
  90. where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
  91. </update>
  92. <!--查询项目状态-->
  93. <select id="selectProjectNowRunState" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
  94. select now_run_state
  95. from simulation_automatic_project
  96. where
  97. is_deleted='0' and
  98. id in
  99. <foreach collection="array" open="(" separator="," close=")" item="id">
  100. #{id,jdbcType=VARCHAR}
  101. </foreach>
  102. </select>
  103. <!--删除-->
  104. <update id="deleteProject">
  105. update simulation_automatic_project
  106. set is_deleted='1'
  107. where id in
  108. <foreach collection="array" open="(" separator="," close=")" item="id">
  109. #{id,jdbcType=VARCHAR}
  110. </foreach>
  111. </update>
  112. </mapper>