123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.kgraph.web.mapper.AirPartInfoMapper">
-
- <resultMap type="AirPartInfo" id="AirPartInfoResult">
- <result property="id" column="id" />
- <result property="name" column="name" />
- <result property="modelComponentId" column="model_component_id" />
- <result property="modelNumber" column="model_number" />
- <result property="airModelId" column="air_model_id" />
- <result property="airNumber" column="air_number" />
- <result property="serial" column="serial" />
- <result property="productionDate" column="production_date" />
- <result property="manufacturerInfo" column="manufacturer_info" />
- <result property="version" column="version" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <sql id="selectAirPartInfoVo">
- SELECT
- api.id,
- api.`name`,
- api.model_component_id,
- api.model_number,
- api.air_model_id,
- ami.air_number,
- api.serial,
- api.production_date,
- api.manufacturer_info,
- api.version,
- api.create_by,
- api.create_time,
- api.update_by,
- api.update_time
- FROM
- t_air_part_info api
- LEFT JOIN t_air_model_info ami ON api.air_model_id = ami.id
- </sql>
- <select id="selectAirPartInfoList" parameterType="AirPartInfo" resultMap="AirPartInfoResult">
- <include refid="selectAirPartInfoVo"/>
- <where>
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
- <if test="modelComponentId != null "> and model_component_id = #{modelComponentId}</if>
- <if test="modelNumber != null and modelNumber != ''"> and model_number = #{modelNumber}</if>
- <if test="airModelId != null "> and air_model_id = #{airModelId}</if>
- <if test="airNumber != null and airNumber != ''"> and air_number = #{airNumber}</if>
- <if test="serial != null and serial != ''"> and serial = #{serial}</if>
- <if test="productionDate != null "> and production_date = #{productionDate}</if>
- <if test="manufacturerInfo != null and manufacturerInfo != ''"> and manufacturer_info = #{manufacturerInfo}</if>
- <if test="version != null and version != ''"> and version = #{version}</if>
- </where>
- </select>
-
- <select id="selectAirPartInfoById" parameterType="Long" resultMap="AirPartInfoResult">
- <include refid="selectAirPartInfoVo"/>
- where api.id = #{id}
- </select>
-
- <insert id="insertAirPartInfo" parameterType="AirPartInfo" useGeneratedKeys="true" keyProperty="id">
- insert into t_air_part_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="name != null">name,</if>
- <if test="modelComponentId != null">model_component_id,</if>
- <if test="modelNumber != null">model_number,</if>
- <if test="airModelId != null">air_model_id,</if>
- <if test="airNumber != null">air_number,</if>
- <if test="serial != null">serial,</if>
- <if test="productionDate != null">production_date,</if>
- <if test="manufacturerInfo != null">manufacturer_info,</if>
- <if test="version != null">version,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="name != null">#{name},</if>
- <if test="modelComponentId != null">#{modelComponentId},</if>
- <if test="modelNumber != null">#{modelNumber},</if>
- <if test="airModelId != null">#{airModelId},</if>
- <if test="airNumber != null">#{airNumber},</if>
- <if test="serial != null">#{serial},</if>
- <if test="productionDate != null">#{productionDate},</if>
- <if test="manufacturerInfo != null">#{manufacturerInfo},</if>
- <if test="version != null">#{version},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <update id="updateAirPartInfo" parameterType="AirPartInfo">
- update t_air_part_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="name != null">name = #{name},</if>
- <if test="modelComponentId != null">model_component_id = #{modelComponentId},</if>
- <if test="modelNumber != null">model_number = #{modelNumber},</if>
- <if test="airModelId != null">air_model_id = #{airModelId},</if>
- <if test="airNumber != null">air_number = #{airNumber},</if>
- <if test="serial != null">serial = #{serial},</if>
- <if test="productionDate != null">production_date = #{productionDate},</if>
- <if test="manufacturerInfo != null">manufacturer_info = #{manufacturerInfo},</if>
- <if test="version != null">version = #{version},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteAirPartInfoById" parameterType="Long">
- delete from t_air_part_info where id = #{id}
- </delete>
- <delete id="deleteAirPartInfoByIds" parameterType="String">
- delete from t_air_part_info where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|