AirSystemInfoMapper.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.kgraph.web.mapper.AirSystemInfoMapper">
  6. <resultMap type="AirSystemInfo" id="AirSystemInfoResult">
  7. <result property="id" column="id" />
  8. <result property="modelComponentId" column="model_component_id" />
  9. <result property="modelNumber" column="model_number" />
  10. <result property="airModelId" column="air_model_id" />
  11. <result property="airNumber" column="air_number" />
  12. <result property="serial" column="serial" />
  13. <result property="productionDate" column="production_date" />
  14. <result property="manufacturerInfo" column="manufacturer_info" />
  15. <result property="version" column="version" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateBy" column="update_by" />
  19. <result property="updateTime" column="update_time" />
  20. </resultMap>
  21. <sql id="selectAirSystemInfoVo">
  22. select id, model_component_id, model_number, air_model_id, air_number, serial, production_date, manufacturer_info, version, create_by, create_time, update_by, update_time from t_air_system_info
  23. </sql>
  24. <select id="selectAirSystemInfoList" parameterType="AirSystemInfo" resultMap="AirSystemInfoResult">
  25. <include refid="selectAirSystemInfoVo"/>
  26. <where>
  27. <if test="modelComponentId != null "> and model_component_id = #{modelComponentId}</if>
  28. <if test="modelNumber != null and modelNumber != ''"> and model_number = #{modelNumber}</if>
  29. <if test="airModelId != null "> and air_model_id = #{airModelId}</if>
  30. <if test="airNumber != null and airNumber != ''"> and air_number = #{airNumber}</if>
  31. <if test="serial != null and serial != ''"> and serial = #{serial}</if>
  32. <if test="productionDate != null "> and production_date = #{productionDate}</if>
  33. <if test="manufacturerInfo != null and manufacturerInfo != ''"> and manufacturer_info = #{manufacturerInfo}</if>
  34. <if test="version != null and version != ''"> and version = #{version}</if>
  35. </where>
  36. </select>
  37. <select id="selectAirSystemInfoById" parameterType="Long" resultMap="AirSystemInfoResult">
  38. <include refid="selectAirSystemInfoVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertAirSystemInfo" parameterType="AirSystemInfo" useGeneratedKeys="true" keyProperty="id">
  42. insert into t_air_system_info
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="modelComponentId != null">model_component_id,</if>
  45. <if test="modelNumber != null">model_number,</if>
  46. <if test="airModelId != null">air_model_id,</if>
  47. <if test="airNumber != null">air_number,</if>
  48. <if test="serial != null">serial,</if>
  49. <if test="productionDate != null">production_date,</if>
  50. <if test="manufacturerInfo != null">manufacturer_info,</if>
  51. <if test="version != null">version,</if>
  52. <if test="createBy != null">create_by,</if>
  53. <if test="createTime != null">create_time,</if>
  54. <if test="updateBy != null">update_by,</if>
  55. <if test="updateTime != null">update_time,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="modelComponentId != null">#{modelComponentId},</if>
  59. <if test="modelNumber != null">#{modelNumber},</if>
  60. <if test="airModelId != null">#{airModelId},</if>
  61. <if test="airNumber != null">#{airNumber},</if>
  62. <if test="serial != null">#{serial},</if>
  63. <if test="productionDate != null">#{productionDate},</if>
  64. <if test="manufacturerInfo != null">#{manufacturerInfo},</if>
  65. <if test="version != null">#{version},</if>
  66. <if test="createBy != null">#{createBy},</if>
  67. <if test="createTime != null">#{createTime},</if>
  68. <if test="updateBy != null">#{updateBy},</if>
  69. <if test="updateTime != null">#{updateTime},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateAirSystemInfo" parameterType="AirSystemInfo">
  73. update t_air_system_info
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="modelComponentId != null">model_component_id = #{modelComponentId},</if>
  76. <if test="modelNumber != null">model_number = #{modelNumber},</if>
  77. <if test="airModelId != null">air_model_id = #{airModelId},</if>
  78. <if test="airNumber != null">air_number = #{airNumber},</if>
  79. <if test="serial != null">serial = #{serial},</if>
  80. <if test="productionDate != null">production_date = #{productionDate},</if>
  81. <if test="manufacturerInfo != null">manufacturer_info = #{manufacturerInfo},</if>
  82. <if test="version != null">version = #{version},</if>
  83. <if test="createBy != null">create_by = #{createBy},</if>
  84. <if test="createTime != null">create_time = #{createTime},</if>
  85. <if test="updateBy != null">update_by = #{updateBy},</if>
  86. <if test="updateTime != null">update_time = #{updateTime},</if>
  87. </trim>
  88. where id = #{id}
  89. </update>
  90. <delete id="deleteAirSystemInfoById" parameterType="Long">
  91. delete from t_air_system_info where id = #{id}
  92. </delete>
  93. <delete id="deleteAirSystemInfoByIds" parameterType="String">
  94. delete from t_air_system_info where id in
  95. <foreach item="id" collection="array" open="(" separator="," close=")">
  96. #{id}
  97. </foreach>
  98. </delete>
  99. </mapper>