123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.ruoyi.syzy.mapper.BBusiWishRecordsMapper">
- <resultMap type="BBusiWishRecords" id="BBusiWishRecordsResult">
- <result property="id" column="id" />
- <result property="customerCode" column="customerCode" />
- <result property="type" column="type" />
- <result property="code" column="code" />
- <result property="name" column="name" />
- <result property="batch" column="batch" />
- <result property="batchName" column="batchName" />
- <result property="detail" column="detail" />
- <result property="userSnapshot" column="userSnapshot" />
- <result property="createTime" column="createTime" />
- <result property="status" column="status" />
- <result property="obsoleted" column="obsoleted" />
- </resultMap>
- <sql id="selectBBusiWishRecordsVo">
- select id, customerCode, type, code, name, batch,batchName, userSnapshot,detail, createTime, status,obsoleted from b_busi_wish_records
- </sql>
- <select id="selectBBusiWishRecordsList" parameterType="BBusiWishRecords" resultMap="BBusiWishRecordsResult">
- <include refid="selectBBusiWishRecordsVo" />
- <where>
- <if test="id != null"> and id = #{id}</if>
- <if test="customerCode != null and customerCode != ''"> and customerCode = #{customerCode}</if>
- <if test="type != null "> and type = #{type}</if>
- <if test="code != null and code != ''"> and code = #{code}</if>
- <if test="name != null and name != '' and !exactName"> and name like concat('%', #{name}, '%')</if>
- <if test="name != null and name != '' and exactName"> and name = #{name}</if>
- <if test="batch != null and batch != ''"> and batch = #{batch}</if>
- <if test="batchName != null and batchName != ''"> and batchName = #{batchName}</if>
- <if test="userSnapshot != null and userSnapshot != ''"> and userSnapshot = #{userSnapshot}</if>
- <if test="detail != null and detail != ''"> and detail = #{detail}</if>
- <if test="createTime != null "> and createTime = #{createTime}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="obsoleted != null "> and obsoleted = #{obsoleted}</if>
- </where>
- order by id desc
- </select>
- <select id="selectBBusiWishRecordsById" parameterType="Long" resultMap="BBusiWishRecordsResult">
- <include refid="selectBBusiWishRecordsVo" />
- where id = #{id}
- </select>
- <insert id="insertBBusiWishRecords" parameterType="BBusiWishRecords" useGeneratedKeys="true" keyProperty="id">
- insert into b_busi_wish_records
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerCode != null and customerCode != ''">customerCode,</if>
- <if test="type != null">type,</if>
- <if test="code != null">code,</if>
- <if test="name != null">name,</if>
- <if test="batch != null">batch,</if>
- <if test="batchName != null">batchName,</if>
- <if test="userSnapshot != null">userSnapshot,</if>
- <if test="detail != null">detail,</if>
- <if test="createTime != null">createTime,</if>
- <if test="status != null">status,</if>
- <if test="obsoleted != null">obsoleted,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="customerCode != null and customerCode != ''">#{customerCode},</if>
- <if test="type != null">#{type},</if>
- <if test="code != null">#{code},</if>
- <if test="name != null">#{name},</if>
- <if test="batch != null">#{batch},</if>
- <if test="batchName != null">#{batchName},</if>
- <if test="userSnapshot != null">#{userSnapshot},</if>
- <if test="detail != null">#{detail},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="status != null">#{status},</if>
- <if test="obsoleted != null">#{obsoleted},</if>
- </trim>
- </insert>
- <update id="updateBBusiWishRecords" parameterType="BBusiWishRecords">
- update b_busi_wish_records
- <trim prefix="SET" suffixOverrides=",">
- <if test="customerCode != null and customerCode != ''">customerCode = #{customerCode},</if>
- <if test="type != null">type = #{type},</if>
- <if test="code != null">code = #{code},</if>
- <if test="name != null">name = #{name},</if>
- <if test="batch != null">batch = #{batch},</if>
- <if test="batchName != null">batchName = #{batchName},</if>
- <if test="userSnapshot != null">userSnapshot = #{userSnapshot},</if>
- <if test="detail != null">detail = #{detail},</if>
- <if test="createTime != null">createTime = #{createTime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="obsoleted != null">obsoleted = #{obsoleted},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateObsoleteByUser" parameterType="Long">
- update b_busi_wish_records wr set wr.obsoleted = true where wr.customerCode = #{userId}
- </update>
- <delete id="deleteBBusiWishRecordsById" parameterType="Long">
- delete from b_busi_wish_records where id = #{id}
- </delete>
- <delete id="deleteBBusiWishRecordsByIds" parameterType="String">
- delete from b_busi_wish_records where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|