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.
223 lines
8.9 KiB
XML
223 lines
8.9 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.InvMaintenanceOrderDao">
|
|
<resultMap id="BaseResultMap" type="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity">
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
<result column="orderId" jdbcType="VARCHAR" property="orderId"/>
|
|
<result column="invWarehouseCode" jdbcType="VARCHAR" property="invWarehouseCode"/>
|
|
<result column="invSpaceCode" jdbcType="VARCHAR" property="invSpaceCode"/>
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
<result column="createTime" jdbcType="VARCHAR" property="createTime"/>
|
|
<result column="updateTime" jdbcType="VARCHAR" property="updateTime"/>
|
|
<result column="auditTime" jdbcType="VARCHAR" property="auditTime"/>
|
|
<result column="createUser" jdbcType="VARCHAR" property="createUser"/>
|
|
<result column="auditUser" jdbcType="VARCHAR" property="auditUser"/>
|
|
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id,
|
|
orderId,
|
|
invWarehouseCode,
|
|
invSpaceCode,
|
|
`status`,
|
|
createTime,
|
|
updateTime,
|
|
auditTime,
|
|
`createUser`,
|
|
auditUser,
|
|
remark
|
|
</sql>
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from inv_maintenance_order
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete
|
|
from inv_maintenance_order
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id"
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity" useGeneratedKeys="true">
|
|
insert into inv_maintenance_order (orderId, invWarehouseCode, invSpaceCode,
|
|
`status`, createTime, updateTime,
|
|
auditTime, `createUser`, auditUser,
|
|
remark)
|
|
values (#{orderId,jdbcType=VARCHAR}, #{invWarehouseCode,jdbcType=VARCHAR}, #{invSpaceCode,jdbcType=VARCHAR},
|
|
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR},
|
|
#{auditTime,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{auditUser,jdbcType=VARCHAR},
|
|
#{remark,jdbcType=VARCHAR})
|
|
</insert>
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id"
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity" useGeneratedKeys="true">
|
|
insert into inv_maintenance_order
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="orderId != null">
|
|
orderId,
|
|
</if>
|
|
<if test="invWarehouseCode != null">
|
|
invWarehouseCode,
|
|
</if>
|
|
<if test="invSpaceCode != null">
|
|
invSpaceCode,
|
|
</if>
|
|
<if test="status != null">
|
|
`status`,
|
|
</if>
|
|
<if test="createTime != null">
|
|
createTime,
|
|
</if>
|
|
<if test="updateTime != null">
|
|
updateTime,
|
|
</if>
|
|
<if test="auditTime != null">
|
|
auditTime,
|
|
</if>
|
|
<if test="createUser != null">
|
|
`createUser`,
|
|
</if>
|
|
<if test="auditUser != null">
|
|
auditUser,
|
|
</if>
|
|
<if test="remark != null">
|
|
remark,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="orderId != null">
|
|
#{orderId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="invWarehouseCode != null">
|
|
#{invWarehouseCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="invSpaceCode != null">
|
|
#{invSpaceCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null">
|
|
#{status,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createTime != null">
|
|
#{createTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
#{updateTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="auditTime != null">
|
|
#{auditTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createUser != null">
|
|
#{createUser,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="auditUser != null">
|
|
#{auditUser,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="remark != null">
|
|
#{remark,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateByPrimaryKeySelective"
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity">
|
|
update inv_maintenance_order
|
|
<set>
|
|
<if test="orderId != null">
|
|
orderId = #{orderId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="invWarehouseCode != null">
|
|
invWarehouseCode = #{invWarehouseCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="invSpaceCode != null">
|
|
invSpaceCode = #{invSpaceCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="status != null">
|
|
`status` = #{status,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createTime != null">
|
|
createTime = #{createTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
updateTime = #{updateTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="auditTime != null">
|
|
auditTime = #{auditTime,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createUser != null">
|
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="auditUser != null">
|
|
auditUser = #{auditUser,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="remark != null">
|
|
remark = #{remark,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderEntity">
|
|
update inv_maintenance_order
|
|
set orderId = #{orderId,jdbcType=VARCHAR},
|
|
invWarehouseCode = #{invWarehouseCode,jdbcType=VARCHAR},
|
|
invSpaceCode = #{invSpaceCode,jdbcType=VARCHAR},
|
|
`status` = #{status,jdbcType=INTEGER},
|
|
createTime = #{createTime,jdbcType=VARCHAR},
|
|
updateTime = #{updateTime,jdbcType=VARCHAR},
|
|
auditTime = #{auditTime,jdbcType=VARCHAR},
|
|
`createUser` = #{createUser,jdbcType=VARCHAR},
|
|
auditUser = #{auditUser,jdbcType=VARCHAR},
|
|
remark = #{remark,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
<select id="filterList" resultType="com.glxp.api.admin.res.inventory.InvMAOrderResponse">
|
|
select ma.id,
|
|
ma.orderId,
|
|
ma.invWarehouseCode,
|
|
ma.invSpaceCode,
|
|
ma.status,
|
|
ma.createTime,
|
|
ma.updateTime,
|
|
ma.auditTime,
|
|
ma.createUser,
|
|
ma.auditUser,
|
|
ma.remark,
|
|
inv_warehouse_sub.name invWarehouseName,
|
|
inv_space.name invSpaceName
|
|
from inv_maintenance_order ma
|
|
left join inv_warehouse_sub on ma.invWarehouseCode = inv_warehouse_sub.code
|
|
left join inv_space
|
|
on ma.invSpaceCode = inv_space.code and inv_warehouse_sub.code = inv_space.invWarehouseCode
|
|
<where>
|
|
<if test="id != null">
|
|
AND ma.id = #{id}
|
|
</if>
|
|
<if test="orderId != null and orderId != ''">
|
|
AND ma.orderId = #{orderId}
|
|
</if>
|
|
<if test="invWarehouseCode != null and invWarehouseCode != ''">
|
|
AND ma.invWarehouseCode = #{invWarehouseCode}
|
|
</if>
|
|
<if test="invSpaceCode != null and invSpaceCode != ''">
|
|
AND ma.invSpaceCode = #{invSpaceCode}
|
|
</if>
|
|
<if test="status != null">
|
|
AND ma.status = #{status}
|
|
</if>
|
|
</where>
|
|
order by ma.updateTime desc
|
|
</select>
|
|
|
|
<select id="selectByOrderId" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List"/>
|
|
from inv_maintenance_order
|
|
where orderId = #{orderId}
|
|
</select>
|
|
</mapper> |