You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spms-java/api-admin/src/main/resources/mybatis/mapper/inout/WarehouseUserDao.xml

266 lines
10 KiB
XML

<?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.glxp.sale.admin.dao.inout.WarehouseUserDao">
<resultMap id="BaseResultMap" type="com.glxp.sale.admin.entity.inout.WarehouseUserEntity">
<!--@mbg.generated-->
<!--@Table inv_warehouse_user-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="userId" jdbcType="BIGINT" property="userid"/>
<result column="userName" jdbcType="VARCHAR" property="username"/>
<result column="isDirector" javaType="boolean" property="isDirector"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, userId, userName, isDirector
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from inv_warehouse_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from inv_warehouse_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into inv_warehouse_user (code, userId, userName, isDirector
)
values (#{code,jdbcType=VARCHAR}, #{userid,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{isDirector}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into inv_warehouse_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">
code,
</if>
<if test="userid != null">
userId,
</if>
<if test="username != null">
userName,
</if>
isDirector
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=BIGINT},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
#{isDirector}
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity">
<!--@mbg.generated-->
update inv_warehouse_user
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="userid != null">
userId = #{userid,jdbcType=BIGINT},
</if>
<if test="username != null">
userName = #{username,jdbcType=VARCHAR},
</if>
</set>
isDirector = #{isDirector}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity">
<!--@mbg.generated-->
update inv_warehouse_user
set code = #{code,jdbcType=VARCHAR},
userId = #{userid,jdbcType=BIGINT},
userName = #{username,jdbcType=VARCHAR}
isDirector = #{isDirector}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update inv_warehouse_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.code,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="userId = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.userid,jdbcType=BIGINT}
</foreach>
</trim>
<trim prefix="userName = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update inv_warehouse_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.code != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.code,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="userId = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.userid != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.userid,jdbcType=BIGINT}
</if>
</foreach>
</trim>
<trim prefix="userName = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.username != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into inv_warehouse_user
(code, userId, userName, isDirector)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.userid,jdbcType=BIGINT}, #{item.username,jdbcType=VARCHAR},
#{item.isDirector}
)
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into inv_warehouse_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
code,
userId,
userName,
isDirector,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{code,jdbcType=VARCHAR},
#{userid,jdbcType=BIGINT},
#{username,jdbcType=VARCHAR},
#{isDirector}
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
code = #{code,jdbcType=VARCHAR},
userId = #{userid,jdbcType=BIGINT},
userName = #{username,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.inout.WarehouseUserEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into inv_warehouse_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="userid != null">
userId,
</if>
<if test="username != null">
userName,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=BIGINT},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="userid != null">
userId = #{userid,jdbcType=BIGINT},
</if>
<if test="username != null">
userName = #{username,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="selectListByCode" resultMap="BaseResultMap">
select inv_warehouse_user.*, auth_user.employeeName
from inv_warehouse_user
inner join auth_user on auth_user.id = inv_warehouse_user.userId
where code = #{code}
</select>
<delete id="deleteByCode">
delete
from inv_warehouse_user
where code = #{code}
</delete>
<update id="updateDirector">
update inv_warehouse_user
set isDirector = #{isDirector}
where code = #{code}
</update>
<update id="updateDirectorById">
update inv_warehouse_user
set isDirector = #{isDirector}
where id = #{id}
</update>
</mapper>