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.
udiwms-java/api-admin/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml

102 lines
3.7 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.api.admin.dao.inventory.InvWarehouseDao">
<select id="filterInvWarehouse" parameterType="com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest"
resultType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
SELECT * FROM inv_warehouse
<where>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="pid != '' and pid != null">
AND pid = #{pid}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="name != '' and name != null">
AND name = #{name}
</if>
<if test=" advanceType != null">
AND advanceType = #{advanceType}
</if>
<if test="isDefault != null">
AND isDefault = #{isDefault}
</if>
<if test="key != null">
and code like concat('%',#{key},'%') or `name` like concat('%',#{key},'%')
</if>
</where>
</select>
<select id="selectById" parameterType="Map"
resultType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
SELECT *
FROM inv_warehouse
WHERE id = #{id}
</select>
<select id="filterGroupInvWarehouse" parameterType="com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
SELECT * FROM inv_warehouse
<where>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="pid != '' and pid != null">
AND pid = #{pid}
</if>
<if test="code != '' and code != null">
AND code = #{code}
</if>
<if test="name != '' and name != null">
AND name = #{name}
</if>
<if test="advanceType != '' and advanceType != null">
AND advanceType = #{advanceType}
</if>
<if test="isDefault != '' and isDefault != null">
AND isDefault = #{isDefault}
</if>
</where>
</select>
<insert id="insertInvWarehouse" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
insert INTO inv_warehouse
(pid, code, name, advanceType, isDefault,
status, updateTime, remark)
values (#{pid}, #{code},
#{name}, #{advanceType}, #{isDefault},
#{status}, #{updateTime},
#{remark})
</insert>
<delete id="deleteById" parameterType="Map">
DELETE
FROM inv_warehouse
WHERE id = #{id}
</delete>
<update id="updateInvWarehouse" parameterType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
UPDATE inv_warehouse
<trim prefix="set" suffixOverrides=",">
<if test="pid != null">pid=#{pid},</if>
<if test="name != null">name=#{name},</if>
<if test="code != null">code=#{code},</if>
<if test="advanceType != null">advanceType=#{advanceType},</if>
<if test="isDefault != null">isDefault=#{isDefault},</if>
<if test="status != null">status=#{status},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="remark != null">remark=#{remark},</if>
</trim>
WHERE id = #{id}
</update>
</mapper>