|
@@ -0,0 +1,193 @@
|
|
|
+<?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.zkqy.business.mapper.InboundRecordsMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zkqy.business.domain.InboundRecords" id="InboundRecordsResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="inboundUnitName" column="inbound_unit_name" />
|
|
|
+ <result property="inboundType" column="inbound_type" />
|
|
|
+ <result property="inboundTime" column="inbound_time" />
|
|
|
+ <result property="inboundAterialsName" column="inbound_aterials_name" />
|
|
|
+ <result property="specifications" column="specifications" />
|
|
|
+ <result property="inboundUnit" column="inbound_unit" />
|
|
|
+ <result property="inboundQuantity" column="inbound_quantity" />
|
|
|
+ <result property="inboundUnitPrice" column="inbound_unit_price" />
|
|
|
+ <result property="inboundAmounts" column="inbound_amounts" />
|
|
|
+ <result property="inboundNotes" column="inbound_notes" />
|
|
|
+ <result property="inboundUsage" column="inbound_usage" />
|
|
|
+ <result property="inboundApprove" column="inbound_approve" />
|
|
|
+ <result property="inboundPresenter" column="inbound_presenter" />
|
|
|
+ <result property="inboundLeader" column="inbound_leader" />
|
|
|
+ <result property="materielId" column="materiel_id" />
|
|
|
+ <result property="serialNumber" column="serialNumber" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="dataApprovalStatus" column="data_approval_status" />
|
|
|
+ <result property="processKey" column="process_key" />
|
|
|
+ <result property="taskProcessKey" column="task_process_key" />
|
|
|
+ <result property="taskNodeKey" column="task_node_key" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectInboundRecordsVo">
|
|
|
+ select id, inbound_unit_name, inbound_type, inbound_time, inbound_aterials_name,
|
|
|
+ specifications, inbound_unit, inbound_quantity, inbound_unit_price, inbound_amounts,
|
|
|
+ inbound_notes, inbound_usage, inbound_approve, inbound_presenter, inbound_leader, materiel_id,
|
|
|
+ serialNumber, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time,
|
|
|
+ del_flag, data_approval_status, process_key, task_process_key, task_node_key from {DBNAME}.inbound_records
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectInboundRecordsList" parameterType="com.zkqy.business.domain.InboundRecords" resultMap="InboundRecordsResult">
|
|
|
+ <include refid="selectInboundRecordsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="inboundUnitName != null and inboundUnitName != ''"> and inbound_unit_name like concat('%', #{inboundUnitName}, '%')</if>
|
|
|
+ <if test="inboundType != null and inboundType != ''"> and inbound_type = #{inboundType}</if>
|
|
|
+ <if test="inboundTime != null "> and inbound_time = #{inboundTime}</if>
|
|
|
+ <if test="inboundAterialsName != null and inboundAterialsName != ''"> and inbound_aterials_name like concat('%', #{inboundAterialsName}, '%')</if>
|
|
|
+ <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
|
|
|
+ <if test="inboundUnit != null and inboundUnit != ''"> and inbound_unit = #{inboundUnit}</if>
|
|
|
+ <if test="inboundQuantity != null and inboundQuantity != ''"> and inbound_quantity = #{inboundQuantity}</if>
|
|
|
+ <if test="inboundUnitPrice != null and inboundUnitPrice != ''"> and inbound_unit_price = #{inboundUnitPrice}</if>
|
|
|
+ <if test="inboundAmounts != null and inboundAmounts != ''"> and inbound_amounts = #{inboundAmounts}</if>
|
|
|
+ <if test="inboundNotes != null and inboundNotes != ''"> and inbound_notes = #{inboundNotes}</if>
|
|
|
+ <if test="inboundUsage != null and inboundUsage != ''"> and inbound_usage = #{inboundUsage}</if>
|
|
|
+ <if test="inboundApprove != null and inboundApprove != ''"> and inbound_approve = #{inboundApprove}</if>
|
|
|
+ <if test="inboundPresenter != null and inboundPresenter != ''"> and inbound_presenter = #{inboundPresenter}</if>
|
|
|
+ <if test="inboundLeader != null and inboundLeader != ''"> and inbound_leader = #{inboundLeader}</if>
|
|
|
+ <if test="materielId != null and materielId != ''"> and materiel_id = #{materielId}</if>
|
|
|
+ <if test="serialNumber != null and serialNumber != ''"> and serialNumber = #{serialNumber}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+ <if test="dataApprovalStatus != null and dataApprovalStatus != ''"> and data_approval_status = #{dataApprovalStatus}</if>
|
|
|
+ <if test="processKey != null and processKey != ''"> and process_key = #{processKey}</if>
|
|
|
+ <if test="taskProcessKey != null and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
|
|
|
+ <if test="taskNodeKey != null and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInboundRecordsById" parameterType="Long" resultMap="InboundRecordsResult">
|
|
|
+ <include refid="selectInboundRecordsVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectInboundRecordsByQtCodeNumber" resultType="com.zkqy.business.domain.InboundRecords">
|
|
|
+ <include refid="selectInboundRecordsVo"/>
|
|
|
+ where qtCodeNumber = #{qtCodeNumber}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertInboundRecords" parameterType="com.zkqy.business.domain.InboundRecords" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into {DBNAME}.inbound_records
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="inboundUnitName != null">inbound_unit_name,</if>
|
|
|
+ <if test="inboundType != null">inbound_type,</if>
|
|
|
+ <if test="inboundTime != null">inbound_time,</if>
|
|
|
+ <if test="inboundAterialsName != null">inbound_aterials_name,</if>
|
|
|
+ <if test="specifications != null">specifications,</if>
|
|
|
+ <if test="inboundUnit != null">inbound_unit,</if>
|
|
|
+ <if test="inboundQuantity != null">inbound_quantity,</if>
|
|
|
+ <if test="inboundUnitPrice != null">inbound_unit_price,</if>
|
|
|
+ <if test="inboundAmounts != null">inbound_amounts,</if>
|
|
|
+ <if test="inboundNotes != null">inbound_notes,</if>
|
|
|
+ <if test="inboundUsage != null">inbound_usage,</if>
|
|
|
+ <if test="inboundApprove != null">inbound_approve,</if>
|
|
|
+ <if test="inboundPresenter != null">inbound_presenter,</if>
|
|
|
+ <if test="inboundLeader != null">inbound_leader,</if>
|
|
|
+ <if test="materielId != null">materiel_id,</if>
|
|
|
+ <if test="serialNumber != null">serialNumber,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="dataApprovalStatus != null">data_approval_status,</if>
|
|
|
+ <if test="processKey != null">process_key,</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key,</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="inboundUnitName != null">#{inboundUnitName},</if>
|
|
|
+ <if test="inboundType != null">#{inboundType},</if>
|
|
|
+ <if test="inboundTime != null">#{inboundTime},</if>
|
|
|
+ <if test="inboundAterialsName != null">#{inboundAterialsName},</if>
|
|
|
+ <if test="specifications != null">#{specifications},</if>
|
|
|
+ <if test="inboundUnit != null">#{inboundUnit},</if>
|
|
|
+ <if test="inboundQuantity != null">#{inboundQuantity},</if>
|
|
|
+ <if test="inboundUnitPrice != null">#{inboundUnitPrice},</if>
|
|
|
+ <if test="inboundAmounts != null">#{inboundAmounts},</if>
|
|
|
+ <if test="inboundNotes != null">#{inboundNotes},</if>
|
|
|
+ <if test="inboundUsage != null">#{inboundUsage},</if>
|
|
|
+ <if test="inboundApprove != null">#{inboundApprove},</if>
|
|
|
+ <if test="inboundPresenter != null">#{inboundPresenter},</if>
|
|
|
+ <if test="inboundLeader != null">#{inboundLeader},</if>
|
|
|
+ <if test="materielId != null">#{materielId},</if>
|
|
|
+ <if test="serialNumber != null">#{serialNumber},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="dataApprovalStatus != null">#{dataApprovalStatus},</if>
|
|
|
+ <if test="processKey != null">#{processKey},</if>
|
|
|
+ <if test="taskProcessKey != null">#{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">#{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateInboundRecords" parameterType="com.zkqy.business.domain.InboundRecords">
|
|
|
+ update {DBNAME}.inbound_records
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="inboundUnitName != null">inbound_unit_name = #{inboundUnitName},</if>
|
|
|
+ <if test="inboundType != null">inbound_type = #{inboundType},</if>
|
|
|
+ <if test="inboundTime != null">inbound_time = #{inboundTime},</if>
|
|
|
+ <if test="inboundAterialsName != null">inbound_aterials_name = #{inboundAterialsName},</if>
|
|
|
+ <if test="specifications != null">specifications = #{specifications},</if>
|
|
|
+ <if test="inboundUnit != null">inbound_unit = #{inboundUnit},</if>
|
|
|
+ <if test="inboundQuantity != null">inbound_quantity = #{inboundQuantity},</if>
|
|
|
+ <if test="inboundUnitPrice != null">inbound_unit_price = #{inboundUnitPrice},</if>
|
|
|
+ <if test="inboundAmounts != null">inbound_amounts = #{inboundAmounts},</if>
|
|
|
+ <if test="inboundNotes != null">inbound_notes = #{inboundNotes},</if>
|
|
|
+ <if test="inboundUsage != null">inbound_usage = #{inboundUsage},</if>
|
|
|
+ <if test="inboundApprove != null">inbound_approve = #{inboundApprove},</if>
|
|
|
+ <if test="inboundPresenter != null">inbound_presenter = #{inboundPresenter},</if>
|
|
|
+ <if test="inboundLeader != null">inbound_leader = #{inboundLeader},</if>
|
|
|
+ <if test="materielId != null">materiel_id = #{materielId},</if>
|
|
|
+ <if test="serialNumber != null">serialNumber = #{serialNumber},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
|
|
|
+ <if test="processKey != null">process_key = #{processKey},</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteInboundRecordsById" parameterType="Long">
|
|
|
+ delete from {DBNAME}.inbound_records where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteInboundRecordsByIds" parameterType="String">
|
|
|
+ delete from {DBNAME}.inbound_records where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|