Model3dMapper.xml 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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="createBy" column="create_by" />
  13. <result property="createTime" column="create_time" />
  14. <result property="updateBy" column="update_by" />
  15. <result property="updateTime" column="update_time" />
  16. </resultMap>
  17. <sql id="selectModel3dVo">
  18. select id, name, aircraft_type,model_3d_file, model_3d_file_path, create_by, create_time, update_by, update_time from bz_model_3d_t
  19. </sql>
  20. <select id="selectModel3dList" parameterType="Model3d" resultMap="Model3dResult">
  21. <include refid="selectModel3dVo"/>
  22. <where>
  23. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  24. <if test="aircraftType!= null and aircraftType!=''">and aircraft_type = #{aircraftType}</if>
  25. <if test="model3dFile != null and model3dFile != ''"> and model_3d_file = #{model3dFile}</if>
  26. <if test="model3dFilePath != null and model3dFilePath != ''"> and model_3d_file_path = #{model3dFilePath}</if>
  27. </where>
  28. </select>
  29. <select id="selectModel3dById" parameterType="Long" resultMap="Model3dResult">
  30. <include refid="selectModel3dVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertModel3d" parameterType="Model3d" useGeneratedKeys="true" keyProperty="id">
  34. insert into bz_model_3d_t
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="name != null and name != ''">name,</if>
  37. <if test="aircraftType != null and aircraftType!=''">aircraft_type,</if>
  38. <if test="model3dFile != null and model3dFile != ''">model_3d_file,</if>
  39. <if test="model3dFilePath != null and model3dFilePath != ''">model_3d_file_path,</if>
  40. <if test="createBy != null">create_by,</if>
  41. <if test="createTime != null">create_time,</if>
  42. <if test="updateBy != null">update_by,</if>
  43. <if test="updateTime != null">update_time,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="name != null and name != ''">#{name},</if>
  47. <if test="aircraftType!=null and aircraftType!=''">#{aircraftType},</if>
  48. <if test="model3dFile != null and model3dFile != ''">#{model3dFile},</if>
  49. <if test="model3dFilePath != null and model3dFilePath != ''">#{model3dFilePath},</if>
  50. <if test="createBy != null">#{createBy},</if>
  51. <if test="createTime != null">#{createTime},</if>
  52. <if test="updateBy != null">#{updateBy},</if>
  53. <if test="updateTime != null">#{updateTime},</if>
  54. </trim>
  55. </insert>
  56. <update id="updateModel3d" parameterType="Model3d">
  57. update bz_model_3d_t
  58. <trim prefix="SET" suffixOverrides=",">
  59. <if test="name != null and name != ''">name = #{name},</if>
  60. <if test="aircraftType!=null and aircraftType!=''">aircraft_type=#{aircraftType},</if>
  61. <if test="model3dFile != null and model3dFile != ''">model_3d_file = #{model3dFile},</if>
  62. <if test="model3dFilePath != null and model3dFilePath != ''">model_3d_file_path = #{model3dFilePath},</if>
  63. <if test="createBy != null">create_by = #{createBy},</if>
  64. <if test="createTime != null">create_time = #{createTime},</if>
  65. <if test="updateBy != null">update_by = #{updateBy},</if>
  66. <if test="updateTime != null">update_time = #{updateTime},</if>
  67. </trim>
  68. where id = #{id}
  69. </update>
  70. <delete id="deleteModel3dById" parameterType="Long">
  71. delete from bz_model_3d_t where id = #{id}
  72. </delete>
  73. <delete id="deleteModel3dByIds" parameterType="String">
  74. delete from bz_model_3d_t where id in
  75. <foreach item="id" collection="array" open="(" separator="," close=")">
  76. #{id}
  77. </foreach>
  78. </delete>
  79. <select id="getOption" resultType="Map">
  80. select id, name from bz_model_3d_t order by id desc
  81. </select>
  82. </mapper>