ScenePackageSublistMapper.xml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.scene.mapper.ScenePackageSublistMapper">
  4. <insert id="saveScenePackageSublist" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO">
  5. insert into simulation.scene_package_sublist
  6. (sublist_id,sublist_name,weight,rule_name,package_and_rules,
  7. scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids,
  8. scene_num,parent_id,root_id,seq,package_level,remarks,
  9. create_user_id,create_time,modify_user_id,modify_time,
  10. is_deleted,share)
  11. values (#{id,jdbcType=VARCHAR},#{sublistName,jdbcType=VARCHAR},#{weight,jdbcType=VARCHAR},#{ruleName,jdbcType=VARCHAR},
  12. #{packageAndRules,jdbcType=VARCHAR},
  13. #{sceneNaturalIds}, #{sceneTrafficIds}, #{sceneStatueIds}, #{sceneGeneralizationIds},
  14. #{sceneNum},#{parentId,jdbcType=VARCHAR},#{rootId,jdbcType=VARCHAR},#{seq},
  15. #{packageLevel},#{remarks},
  16. #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
  17. #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
  18. </insert>
  19. <insert id="saveScenePackageSublistAll" parameterType="java.util.List">
  20. insert into simulation.scene_package_sublist
  21. (sublist_id,sublist_name,weight,rule_name,package_and_rules,
  22. scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids,
  23. scene_num,parent_id,root_id,seq,package_level,remarks,
  24. create_user_id,create_time,modify_user_id,modify_time,
  25. is_deleted,share) values
  26. <foreach collection="list" index="index" item="item" separator=",">
  27. (#{item.id,jdbcType=VARCHAR},#{item.sublistName,jdbcType=VARCHAR},#{item.weight,jdbcType=VARCHAR},#{item.ruleName,jdbcType=VARCHAR},
  28. #{item.packageAndRules,jdbcType=VARCHAR},
  29. #{item.sceneNaturalIds}, #{item.sceneTrafficIds}, #{item.sceneStatueIds}, #{item.sceneGeneralizationIds},
  30. #{item.sceneNum},#{item.parentId,jdbcType=VARCHAR},#{item.rootId,jdbcType=VARCHAR},#{index}+1,
  31. #{item.packageLevel},#{item.remarks},
  32. #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyUserId,jdbcType=VARCHAR},#{item.modifyTime},
  33. #{item.isDeleted,jdbcType=VARCHAR}, #{item.share,jdbcType=VARCHAR})
  34. </foreach>
  35. </insert>
  36. <select id="queryScenePackageSublistList" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO"
  37. resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
  38. select
  39. a.sublist_id id,a.sublist_name,a.weight,b.rule_name,
  40. a.scene_num,a.parent_id,a.root_id,a.package_level,a.remarks,a.seq,a.package_and_rules,
  41. a.scene_natural_ids,a.scene_traffic_ids,a.scene_statue_ids,a.scene_generalization_ids
  42. from simulation.scene_package_sublist as a left join simulation.scoring_rules as b on
  43. a.package_and_rules=b.rules_id
  44. <where>
  45. a.is_deleted = '0'
  46. <if test="id != null and id != ''">
  47. and a.sublist_id = #{id,jdbcType=VARCHAR}
  48. </if>
  49. <if test="sublistName != null and sublistName != ''">
  50. and a.sublist_name = #{sublistName,jdbcType=VARCHAR}
  51. </if>
  52. <if test="createUserId != null and createUserId != ''">
  53. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  54. </if>
  55. <if test="parentId != null and parentId != ''">
  56. and a.parent_id = #{parentId}
  57. </if>
  58. <if test="rootId != null and rootId != ''">
  59. and a.root_id = #{rootId}
  60. </if>
  61. order by seq
  62. </where>
  63. </select>
  64. <update id="deleteScenePackageSublist" parameterType="java.lang.String">
  65. update simulation.scene_package_sublist
  66. set is_deleted='1'
  67. where root_id = #{rootId,jdbcType=VARCHAR}
  68. </update>
  69. <select id="queryBySublistName" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO"
  70. resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
  71. select sublist_id id,sublist_name
  72. from simulation.scene_package_sublist
  73. <where>
  74. is_deleted = '0'
  75. <if test="id != null and id != ''">
  76. and a.sublist_id != #{id,jdbcType=VARCHAR}
  77. </if>
  78. <if test="sublistName != null and sublistName != ''">
  79. and a.sublist_name = #{sublistName,jdbcType=VARCHAR}
  80. </if>
  81. <if test="createUserId != null and createUserId != ''">
  82. and create_user_id=#{createUserId,jdbcType=VARCHAR}
  83. </if>
  84. <if test="share != null and share != ''">
  85. and share=#{share,jdbcType=VARCHAR}
  86. </if>
  87. </where>
  88. </select>
  89. </mapper>