Model3dMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fidms.web.mapper.Model3dMapper">
  6. <resultMap type="Model3d" id="Model3dResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="aircraftType" column="aircraft_type"/>
  10. <result property="model3dFile" column="model_3d_file" />
  11. <result property="model3dFilePath" column="model_3d_file_path" />
  12. <result property="editablemodelpath" column="editable_model_path" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. </resultMap>
  18. <sql id="selectModel3dVo">
  19. select id, name, aircraft_type,model_3d_file, model_3d_file_path, editable_model_path,create_by, create_time, update_by, update_time from bz_model_3d_t
  20. </sql>
  21. <select id="selectModel3dList" parameterType="Model3d" resultMap="Model3dResult">
  22. <include refid="selectModel3dVo"/>
  23. <where>
  24. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  25. <if test="aircraftType!= null and aircraftType!=''">and aircraft_type = #{aircraftType}</if>
  26. <if test="model3dFile != null and model3dFile != ''"> and model_3d_file = #{model3dFile}</if>
  27. <if test="model3dFilePath != null and model3dFilePath != ''"> and model_3d_file_path = #{model3dFilePath}</if>
  28. <if test="editablemodelpath != null and editablemodelpath != ''"> and editable_model_path = #{editablemodelpath}</if>
  29. </where>
  30. </select>
  31. <select id="selectModel3dById" parameterType="Long" resultMap="Model3dResult">
  32. <include refid="selectModel3dVo"/>
  33. where id = #{id}
  34. </select>
  35. <insert id="insertModel3d" parameterType="Model3d" useGeneratedKeys="true" keyProperty="id">
  36. insert into bz_model_3d_t
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="name != null and name != ''">name,</if>
  39. <if test="aircraftType != null and aircraftType!=''">aircraft_type,</if>
  40. <if test="model3dFile != null and model3dFile != ''">model_3d_file,</if>
  41. <if test="model3dFilePath != null and model3dFilePath != ''">model_3d_file_path,</if>
  42. <if test="editablemodelpath != null and editablemodelpath != ''">editable_model_path,</if>
  43. <if test="createBy != null">create_by,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="updateBy != null">update_by,</if>
  46. <if test="updateTime != null">update_time,</if>
  47. </trim>
  48. <trim prefix="values (" suffix=")" suffixOverrides=",">
  49. <if test="name != null and name != ''">#{name},</if>
  50. <if test="aircraftType!=null and aircraftType!=''">#{aircraftType},</if>
  51. <if test="model3dFile != null and model3dFile != ''">#{model3dFile},</if>
  52. <if test="model3dFilePath != null and model3dFilePath != ''">#{model3dFilePath},</if>
  53. <if test="editablemodelpath != null and editablemodelpath != ''">#{editablemodelpath},</if>
  54. <if test="createBy != null">#{createBy},</if>
  55. <if test="createTime != null">#{createTime},</if>
  56. <if test="updateBy != null">#{updateBy},</if>
  57. <if test="updateTime != null">#{updateTime},</if>
  58. </trim>
  59. </insert>
  60. <update id="updateModel3d" parameterType="Model3d">
  61. update bz_model_3d_t
  62. <trim prefix="SET" suffixOverrides=",">
  63. <if test="name != null and name != ''">name = #{name},</if>
  64. <if test="aircraftType!=null and aircraftType!=''">aircraft_type=#{aircraftType},</if>
  65. <if test="model3dFile != null and model3dFile != ''">model_3d_file = #{model3dFile},</if>
  66. <if test="model3dFilePath != null and model3dFilePath != ''">model_3d_file_path = #{model3dFilePath},</if>
  67. <if test="editablemodelpath != null and editablemodelpath != ''">editable_model_path = #{editablemodelpath},</if>
  68. <if test="createBy != null">create_by = #{createBy},</if>
  69. <if test="createTime != null">create_time = #{createTime},</if>
  70. <if test="updateBy != null">update_by = #{updateBy},</if>
  71. <if test="updateTime != null">update_time = #{updateTime},</if>
  72. </trim>
  73. where id = #{id}
  74. </update>
  75. <delete id="deleteModel3dById" parameterType="Long">
  76. delete from bz_model_3d_t where id = #{id}
  77. </delete>
  78. <delete id="deleteModel3dByIds" parameterType="String">
  79. delete from bz_model_3d_t where id in
  80. <foreach item="id" collection="array" open="(" separator="," close=")">
  81. #{id}
  82. </foreach>
  83. </delete>
  84. <select id="getOption" resultType="Map">
  85. select id, name from bz_model_3d_t order by id desc
  86. </select>
  87. </mapper>