123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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.miniapp.bus.mapper.BasicProductMapper">
-
- <resultMap type="com.miniapp.bus.domain.BasicProduct" id="BasicProductResult">
- <result property="id" column="id" />
- <result property="productName" column="productName" />
- <result property="type" column="type" />
- <result property="productType" column="productType" />
- <result property="upload" column="upload" />
- <result property="deltag" column="deltag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectBasicProductVo">
- select id, productName, type, productType, upload, deltag, create_by, create_time, update_by, update_time, remark from basic_product
- </sql>
- <select id="selectBasicProductList" parameterType="BasicProduct" resultMap="BasicProductResult">
- <include refid="selectBasicProductVo"/>
- <where>
- <if test="productName != null and productName != ''"> and productName like concat('%', #{productName}, '%')</if>
- <if test="type != null and type != ''"> and type = #{type}</if>
- <if test="productType != null and productType != ''"> and productType = #{productType}</if>
- <if test="upload != null and upload != ''"> and upload = #{upload}</if>
- <if test="deltag != null and deltag != ''"> and deltag = #{deltag}</if>
- </where>
- </select>
-
- <select id="selectBasicProductById" parameterType="Long" resultMap="BasicProductResult">
- <include refid="selectBasicProductVo"/>
- where id = #{id}
- </select>
- <insert id="insertBasicProduct" parameterType="BasicProduct" useGeneratedKeys="true" keyProperty="id">
- insert into basic_product
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="productName != null">productName,</if>
- <if test="type != null">type,</if>
- <if test="productType != null">productType,</if>
- <if test="upload != null">upload,</if>
- <if test="deltag != null">deltag,</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>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="productName != null">#{productName},</if>
- <if test="type != null">#{type},</if>
- <if test="productType != null">#{productType},</if>
- <if test="upload != null">#{upload},</if>
- <if test="deltag != null">#{deltag},</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>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateBasicProduct" parameterType="BasicProduct">
- update basic_product
- <trim prefix="SET" suffixOverrides=",">
- <if test="productName != null">productName = #{productName},</if>
- <if test="type != null">type = #{type},</if>
- <if test="productType != null">productType = #{productType},</if>
- <if test="upload != null">upload = #{upload},</if>
- <if test="deltag != null">deltag = #{deltag},</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>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteBasicProductById" parameterType="Long">
- delete from basic_product where id = #{id}
- </delete>
- <delete id="deleteBasicProductByIds" parameterType="String">
- delete from basic_product where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|