SceneImportMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.SceneImportMapper" >
  4. <select id="checkName" parameterType="api.common.pojo.po.system.SceneImportPO" resultType="api.common.pojo.po.system.SceneImportPO">
  5. select
  6. id
  7. from scene_import_task
  8. where is_deleted = '0'
  9. and name = #{name,jdbcType=VARCHAR}
  10. and id &lt;&gt; #{id,jdbcType=VARCHAR}
  11. </select>
  12. <select id="querySceneImportByTaskId" parameterType="java.lang.String" resultType="api.common.pojo.po.system.SceneImportPO">
  13. select id,
  14. scene_type,
  15. scene_names
  16. from scene_import_task
  17. where id = #{id}
  18. </select>
  19. <insert id="insert" parameterType="api.common.pojo.po.system.SceneImportPO">
  20. INSERT INTO scene_import_task (
  21. id,
  22. name,
  23. data_directory,
  24. scene_type,
  25. status,
  26. create_user_id,
  27. create_time,
  28. modify_user_id,
  29. modify_time,
  30. evaluation_status,
  31. is_deleted
  32. )VALUES(
  33. #{id,jdbcType=VARCHAR},
  34. #{name,jdbcType=VARCHAR},
  35. #{dataDirectory,jdbcType=VARCHAR},
  36. #{sceneType,jdbcType=VARCHAR},
  37. #{status,jdbcType=VARCHAR},
  38. #{createUserId,jdbcType=VARCHAR},
  39. #{createTime,jdbcType=TIMESTAMP},
  40. #{modifyUserId,jdbcType=VARCHAR},
  41. #{modifyTime,jdbcType=TIMESTAMP},
  42. #{evaluationStatus,jdbcType=VARCHAR},
  43. #{isDeleted,jdbcType=VARCHAR}
  44. )
  45. </insert>
  46. <update id="update" parameterType="api.common.pojo.po.system.SceneImportPO">
  47. update scene_import_task set
  48. name = #{name,jdbcType=VARCHAR},
  49. data_directory = #{dataDirectory,jdbcType=VARCHAR},
  50. scene_type = #{sceneType,jdbcType=VARCHAR},
  51. create_time = #{createTime,jdbcType=TIMESTAMP},
  52. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  53. evaluation_status = #{evaluationStatus,jdbcType=VARCHAR},
  54. modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
  55. where id = #{id,jdbcType=VARCHAR}
  56. </update>
  57. <update id="updateStatus" parameterType="api.common.pojo.po.system.SceneImportPO">
  58. update scene_import_task set
  59. status = #{status,jdbcType=VARCHAR},
  60. error_message = #{errorMessage},
  61. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  62. modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
  63. where id = #{id,jdbcType=VARCHAR}
  64. </update>
  65. <update id="updateInfo" parameterType="api.common.pojo.po.system.SceneImportPO">
  66. update simulation.scene_import_task
  67. set status = #{status,jdbcType=VARCHAR},
  68. false_num = #{falseNum},
  69. success_num = #{successNum},
  70. error_message = #{errorMessage},
  71. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  72. modify_time = #{modifyTime},
  73. scene_names = #{sceneNames},
  74. total_time = TIMESTAMPDIFF(SECOND,create_time, modify_time)
  75. where id = #{id,jdbcType=VARCHAR}
  76. </update>
  77. <select id="getSceneImporPagetList" parameterType="api.common.pojo.param.system.SceneImportPageParam" resultType="api.common.pojo.po.system.SceneImportPO">
  78. select
  79. id,
  80. name,
  81. scene_type,
  82. status,
  83. success_num,
  84. false_num,
  85. error_message,
  86. total_time,
  87. create_time,
  88. is_deleted,
  89. evaluation_status,
  90. evaluation_error_msg,
  91. start_evaluation_time,
  92. end_evaluation_time
  93. from simulation.scene_import_task
  94. where
  95. is_deleted = '0'
  96. <if test="name != null and name != ''">
  97. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  98. </if>
  99. <if test="timeBegin != null and timeBegin != ''">
  100. and DATE(create_time) &gt;= #{timeBegin}
  101. </if>
  102. <if test="timeEnd != null and timeEnd != ''">
  103. and DATE(create_time) &lt;= #{timeEnd}
  104. </if>
  105. order by create_time desc
  106. </select>
  107. <update id="deleteImportTask" parameterType="api.common.pojo.po.system.SceneImportPO">
  108. update scene_import_task
  109. set is_deleted = '1',
  110. modify_time = #{modifyTime},
  111. modify_user_id = #{modifyUserId}
  112. where id = #{id,jdbcType=VARCHAR}
  113. </update>
  114. </mapper>