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/InvMaintenanceOrderDetailDa...

234 lines
9.1 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.InvMaintenanceOrderDetailDao">
<resultMap id="BaseResultMap" type="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="productId" jdbcType="VARCHAR" property="productId"/>
<result column="nameCode" jdbcType="VARCHAR" property="nameCode"/>
<result column="batchNo" jdbcType="VARCHAR" property="batchNo"/>
<result column="produceDate" jdbcType="VARCHAR" property="produceDate"/>
<result column="expireDate" jdbcType="VARCHAR" property="expireDate"/>
<result column="count" jdbcType="INTEGER" property="count"/>
<result column="maintenanceStatus" jdbcType="INTEGER" property="maintenanceStatus"/>
<result column="deviceStatus" jdbcType="INTEGER" property="deviceStatus"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>
<sql id="Base_Column_List">
id,
orderIdFk,
code,
productId,
nameCode,
batchNo,
produceDate,
expireDate,
`count`,
maintenanceStatus,
deviceStatus,
remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from inv_maintenance_order_detail
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete
from inv_maintenance_order_detail
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity" useGeneratedKeys="true">
insert into inv_maintenance_order_detail (orderIdFk, code, productId,
nameCode, batchNo, produceDate,
expireDate, `count`, maintenanceStatus,
deviceStatus, remark)
values (#{orderIdFk,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR},
#{nameCode,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR}, #{produceDate,jdbcType=VARCHAR},
#{expireDate,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}, #{maintenanceStatus,jdbcType=INTEGER},
#{deviceStatus,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity" useGeneratedKeys="true">
insert into inv_maintenance_order_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderIdFk != null">
orderIdFk,
</if>
<if test="code != null">
code,
</if>
<if test="productId != null">
productId,
</if>
<if test="nameCode != null">
nameCode,
</if>
<if test="batchNo != null">
batchNo,
</if>
<if test="produceDate != null">
produceDate,
</if>
<if test="expireDate != null">
expireDate,
</if>
<if test="count != null">
`count`,
</if>
<if test="maintenanceStatus != null">
maintenanceStatus,
</if>
<if test="deviceStatus != null">
deviceStatus,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderIdFk != null">
#{orderIdFk,jdbcType=VARCHAR},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="productId != null">
#{productId,jdbcType=VARCHAR},
</if>
<if test="nameCode != null">
#{nameCode,jdbcType=VARCHAR},
</if>
<if test="batchNo != null">
#{batchNo,jdbcType=VARCHAR},
</if>
<if test="produceDate != null">
#{produceDate,jdbcType=VARCHAR},
</if>
<if test="expireDate != null">
#{expireDate,jdbcType=VARCHAR},
</if>
<if test="count != null">
#{count,jdbcType=INTEGER},
</if>
<if test="maintenanceStatus != null">
#{maintenanceStatus,jdbcType=INTEGER},
</if>
<if test="deviceStatus != null">
#{deviceStatus,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective"
parameterType="com.glxp.api.admin.entity.inventory.InvMaintenanceOrderDetailEntity">
update inv_maintenance_order_detail
<set>
<if test="orderIdFk != null">
orderIdFk = #{orderIdFk,jdbcType=VARCHAR},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="productId != null">
productId = #{productId,jdbcType=VARCHAR},
</if>
<if test="nameCode != null">
nameCode = #{nameCode,jdbcType=VARCHAR},
</if>
<if test="batchNo != null">
batchNo = #{batchNo,jdbcType=VARCHAR},
</if>
<if test="produceDate != null">
produceDate = #{produceDate,jdbcType=VARCHAR},
</if>
<if test="expireDate != null">
expireDate = #{expireDate,jdbcType=VARCHAR},
</if>
<if test="count != null">
`count` = #{count,jdbcType=INTEGER},
</if>
<if test="maintenanceStatus != null">
maintenanceStatus = #{maintenanceStatus,jdbcType=INTEGER},
</if>
<if test="deviceStatus != null">
deviceStatus = #{deviceStatus,jdbcType=INTEGER},
</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.InvMaintenanceOrderDetailEntity">
update inv_maintenance_order_detail
set orderIdFk = #{orderIdFk,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
productId = #{productId,jdbcType=VARCHAR},
nameCode = #{nameCode,jdbcType=VARCHAR},
batchNo = #{batchNo,jdbcType=VARCHAR},
produceDate = #{produceDate,jdbcType=VARCHAR},
expireDate = #{expireDate,jdbcType=VARCHAR},
`count` = #{count,jdbcType=INTEGER},
maintenanceStatus = #{maintenanceStatus,jdbcType=INTEGER},
deviceStatus = #{deviceStatus,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteByOrderId">
delete
from inv_maintenance_order_detail
where orderIdFk = #{orderId}
</delete>
<select id="countByOrderId" resultType="java.lang.Long">
select count(*)
from inv_maintenance_order_detail
where orderIdFk = #{orderId}
</select>
<select id="filterList" resultType="com.glxp.api.admin.res.inventory.InvMAOrderDetailResponse">
select mad.id,
orderIdFk,
code,
productId,
nameCode,
batchNo,
produceDate,
expireDate,
count,
maintenanceStatus,
deviceStatus,
remark,
basic_products.cpmctymc productName
from inv_maintenance_order_detail mad
left join basic_udirel on mad.productId = basic_udirel.id
left join basic_products on basic_products.uuid = basic_udirel.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
</where>
</select>
<select id="selectByOrderIdAndCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from inv_maintenance_order_detail
where orderIdFk = #{orderIdFk}
and code = #{code}
</select>
</mapper>