SceneImportMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.system.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. <insert id="insert" parameterType="api.common.pojo.po.system.SceneImportPO">
  13. INSERT INTO scene_import_task (
  14. id,
  15. name,
  16. data_directory,
  17. scene_type,
  18. status,
  19. create_user_id,
  20. create_time,
  21. modify_user_id,
  22. modify_time,
  23. is_deleted
  24. )VALUES(
  25. #{id,jdbcType=VARCHAR},
  26. #{name,jdbcType=VARCHAR},
  27. #{dataDirectory,jdbcType=VARCHAR},
  28. #{sceneType,jdbcType=VARCHAR},
  29. #{status,jdbcType=VARCHAR},
  30. #{createUserId,jdbcType=VARCHAR},
  31. #{createTime,jdbcType=TIMESTAMP},
  32. #{modifyUserId,jdbcType=VARCHAR},
  33. #{modifyTime,jdbcType=TIMESTAMP},
  34. #{isDeleted,jdbcType=VARCHAR}
  35. )
  36. </insert>
  37. <update id="update" parameterType="api.common.pojo.po.system.SceneImportPO">
  38. update scene_import_task set
  39. name = #{name,jdbcType=VARCHAR},
  40. data_directory = #{dataDirectory,jdbcType=VARCHAR},
  41. scene_type = #{sceneType,jdbcType=VARCHAR},
  42. create_time = #{createTime,jdbcType=TIMESTAMP},
  43. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  44. modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
  45. where id = #{id,jdbcType=VARCHAR}
  46. </update>
  47. <update id="updateStatus" parameterType="api.common.pojo.po.system.SceneImportPO">
  48. update scene_import_task set
  49. status = #{status,jdbcType=VARCHAR},
  50. error_message = #{errorMessage},
  51. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  52. modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
  53. where id = #{id,jdbcType=VARCHAR}
  54. </update>
  55. <update id="updateInfo" parameterType="api.common.pojo.po.system.SceneImportPO">
  56. update simulation.scene_import_task set
  57. status = #{status,jdbcType=VARCHAR},
  58. false_num = #{falseNum},
  59. success_num = #{successNum},
  60. error_message = #{errorMessage},
  61. modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
  62. total_time = TIMESTAMPDIFF(SECOND,create_time,#{modifyTime}),
  63. modify_time=#{modifyTime}
  64. where id = #{id,jdbcType=VARCHAR}
  65. </update>
  66. <select id="getSceneImporPagetList" parameterType="api.common.pojo.param.system.SceneImportPageParam" resultType="api.common.pojo.po.system.SceneImportPO">
  67. select
  68. id,
  69. name,
  70. scene_type,
  71. status,
  72. success_num,
  73. false_num,
  74. error_message,
  75. total_time,
  76. create_time,
  77. is_deleted
  78. from simulation.scene_import_task
  79. where
  80. is_deleted = '0'
  81. <if test="name != null and name != ''">
  82. and name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  83. </if>
  84. <if test="timeBegin != null and timeBegin != ''">
  85. and DATE(create_time) &gt;= #{timeBegin}
  86. </if>
  87. <if test="timeEnd != null and timeEnd != ''">
  88. and DATE(create_time) &lt;= #{timeEnd}
  89. </if>
  90. order by create_time desc
  91. </select>
  92. </mapper>