1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?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.system1.mapper.ShopAdminMapper">
-
- <resultMap type="ShopAdmin" id="ShopAdminResult">
- <result property="shopId" column="shop_id" />
- <result property="userId" column="user_id" />
- </resultMap>
- <sql id="selectShopAdminVo">
- select shop_id, user_id from shop_admin
- </sql>
- <select id="selectShopAdminList" parameterType="ShopAdmin" resultMap="ShopAdminResult">
- <include refid="selectShopAdminVo"/>
- <where>
- </where>
- </select>
-
- <select id="selectShopAdminByShopId" parameterType="Long" resultMap="ShopAdminResult">
- <include refid="selectShopAdminVo"/>
- where shop_id = #{shopId}
- </select>
- <insert id="insertShopAdmin" parameterType="ShopAdmin">
- insert into shop_admin
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="shopId != null">shop_id,</if>
- <if test="userId != null">user_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="shopId != null">#{shopId},</if>
- <if test="userId != null">#{userId},</if>
- </trim>
- </insert>
- <update id="updateShopAdmin" parameterType="ShopAdmin">
- update shop_admin
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- </trim>
- where shop_id = #{shopId}
- </update>
- <delete id="deleteShopAdminByShopId" parameterType="Long">
- delete from shop_admin where shop_id = #{shopId}
- </delete>
- <delete id="deleteShopAdminByShopIds" parameterType="String">
- delete from shop_admin where shop_id in
- <foreach item="shopId" collection="array" open="(" separator="," close=")">
- #{shopId}
- </foreach>
- </delete>
- </mapper>
|