123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?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.base.mapper.CodeSkuRelationshipMapper">
- <resultMap type="CodeSkuRelationship" id="CodeSkuRelationshipResult">
- <result property="id" column="id" />
- <result property="sn" column="sn" />
- <result property="status" column="status" />
- <result property="sku" column="sku" />
- <result property="vdate" column="vdate" />
- <result property="userId" column="user_id" />
- <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>
- <resultMap type="codeSkuRelationshipVO" id="CodeSkuRelationshipVOResult">
- <result property="sn" column="sn" />
- <result property="status" column="status" />
- <result property="sku" column="sku" />
- <result property="skuName" column="desc1" />
- <result property="skuType" column="sku_type" />
- <result property="model" column="model" />
- </resultMap>
- <sql id="selectCodeSkuRelationshipVo">
- select id, sn, status, sku, vdate, user_id, create_by, create_time, update_by, update_time from code_sku_relationship
- </sql>
- <select id="selectCodeSkuRelationshipList" parameterType="CodeSkuRelationshipVO" resultMap="CodeSkuRelationshipResult">
- <include refid="selectCodeSkuRelationshipVo"/>
- <where>
- <if test="sn != null and sn != ''"> and sn = #{sn}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="sku != null and sku != ''"> and sku = #{sku}</if>
- <if test="vdate != null "> and vdate = #{vdate}</if>
- <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
- </where>
- </select>
- <select id="selectCodeSkuRelationshipById" parameterType="Long" resultMap="CodeSkuRelationshipResult">
- <include refid="selectCodeSkuRelationshipVo"/>
- where id = #{id}
- </select>
- <insert id="insertCodeSkuRelationship" parameterType="CodeSkuRelationshipVO" useGeneratedKeys="true" keyProperty="id">
- insert into code_sku_relationship
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sn != null">sn,</if>
- <if test="status != null">status,</if>
- <if test="sku != null">sku,</if>
- <if test="vdate != null">vdate,</if>
- <if test="userId != null">user_id,</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="sn != null">#{sn},</if>
- <if test="status != null">#{status},</if>
- <if test="sku != null">#{sku},</if>
- <if test="vdate != null">#{vdate},</if>
- <if test="userId != null">#{userId},</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="updateCodeSkuRelationship" parameterType="CodeSkuRelationship">
- update code_sku_relationship
- <trim prefix="SET" suffixOverrides=",">
- <if test="sn != null">sn = #{sn},</if>
- <if test="status != null">status = #{status},</if>
- <if test="sku != null">sku = #{sku},</if>
- <if test="vdate != null">vdate = #{vdate},</if>
- <if test="userId != null">user_id = #{userId},</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="deleteCodeSkuRelationshipById" parameterType="Long">
- delete from code_sku_relationship where id = #{id}
- </delete>
- <delete id="deleteCodeSkuRelationshipByIds" parameterType="String">
- delete from code_sku_relationship where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectCodeSkuRelationshipBySn" parameterType="string" resultMap="CodeSkuRelationshipVOResult">
- select c.sn,c.status,s.sku,s.desc1,s.sku_type,s.model
- from code_sku_relationship c
- left join base_sku s on c.sku = s.sku
- where c.sn = #{sn} and c.status = 'Y'
- </select>
- <select id="selectCodeSkuRelationshipVOList" resultType="com.ruoyi.base.domain.vo.CodeSkuRelationshipVO">
- <include refid="selectCodeSkuRelationshipVo"/>
- where 1=1
- <if test="list != null">
- and sn in
- <foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- </mapper>
|