|
@@ -66,6 +66,9 @@
|
|
<result column="item_product_model" property="itemProductModel" jdbcType="VARCHAR" />
|
|
<result column="item_product_model" property="itemProductModel" jdbcType="VARCHAR" />
|
|
<result column="item_product_unit" property="itemProductUnit" jdbcType="VARCHAR" />
|
|
<result column="item_product_unit" property="itemProductUnit" jdbcType="VARCHAR" />
|
|
<result column="item_product_box_number" property="itemProductBoxNumber" jdbcType="INTEGER" />
|
|
<result column="item_product_box_number" property="itemProductBoxNumber" jdbcType="INTEGER" />
|
|
|
|
+ <result column="item_should_storage" property="itemShouldStorage" jdbcType="INTEGER" />
|
|
|
|
+ <result column="item_actual_storage" property="itemActualStorage" jdbcType="INTEGER" />
|
|
|
|
+ <result column="item_lack_number" property="itemLackNumber" jdbcType="INTEGER" />
|
|
<result column="item_create_time" property="itemCreateTime" jdbcType="TIMESTAMP" />
|
|
<result column="item_create_time" property="itemCreateTime" jdbcType="TIMESTAMP" />
|
|
<result column="item_update_time" property="itemUpdateTime" jdbcType="TIMESTAMP" />
|
|
<result column="item_update_time" property="itemUpdateTime" jdbcType="TIMESTAMP" />
|
|
</resultMap>
|
|
</resultMap>
|
|
@@ -151,14 +154,17 @@
|
|
item_product_model,
|
|
item_product_model,
|
|
item_product_unit,
|
|
item_product_unit,
|
|
item_product_box_number,
|
|
item_product_box_number,
|
|
- item_create_time,
|
|
|
|
|
|
+ item_should_storage,
|
|
|
|
+ item_actual_storage,
|
|
|
|
+ item_lack_number,
|
|
|
|
+ item_create_time
|
|
)
|
|
)
|
|
VALUES
|
|
VALUES
|
|
<foreach collection="list" item="item" separator=",">
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
(
|
|
#{item.productionId},#{item.productId},#{item.itemProductName},#{item.itemColorName},
|
|
#{item.productionId},#{item.productId},#{item.itemProductName},#{item.itemColorName},
|
|
#{item.itemProductNum},#{item.itemBrandName},#{item.itemProductModel},#{item.itemProductUnit}
|
|
#{item.itemProductNum},#{item.itemBrandName},#{item.itemProductModel},#{item.itemProductUnit}
|
|
- ,#{item.itemProductBoxNumber},NOW()
|
|
|
|
|
|
+ ,#{item.itemProductBoxNumber},#{item.itemShouldStorage},#{item.itemActualStorage},#{item.itemLackNumber},NOW()
|
|
)
|
|
)
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
@@ -166,10 +172,10 @@
|
|
|
|
|
|
<insert id="insertProductionContract" parameterType="ApprovalProductionContract">
|
|
<insert id="insertProductionContract" parameterType="ApprovalProductionContract">
|
|
INSERT INTO tb_rst_approval_production_contract(
|
|
INSERT INTO tb_rst_approval_production_contract(
|
|
- contract_id
|
|
|
|
- production_id
|
|
|
|
- contract_url
|
|
|
|
- contract_type
|
|
|
|
|
|
+ contract_id,
|
|
|
|
+ production_id,
|
|
|
|
+ contract_url,
|
|
|
|
+ contract_type,
|
|
contract_create_time
|
|
contract_create_time
|
|
)
|
|
)
|
|
VALUES
|
|
VALUES
|
|
@@ -178,10 +184,10 @@
|
|
|
|
|
|
<insert id="insertProcessInfo" parameterType="ProcessInfo">
|
|
<insert id="insertProcessInfo" parameterType="ProcessInfo">
|
|
INSERT INTO tb_rst_process_info(
|
|
INSERT INTO tb_rst_process_info(
|
|
- approval_id
|
|
|
|
- admin_id
|
|
|
|
- process_desc
|
|
|
|
- process_state
|
|
|
|
|
|
+ approval_id,
|
|
|
|
+ admin_id,
|
|
|
|
+ process_desc,
|
|
|
|
+ process_state,
|
|
process_create_time
|
|
process_create_time
|
|
)
|
|
)
|
|
VALUES
|
|
VALUES
|
|
@@ -190,11 +196,11 @@
|
|
|
|
|
|
<insert id="insertHistoricalRecord" parameterType="HistoricalRecord">
|
|
<insert id="insertHistoricalRecord" parameterType="HistoricalRecord">
|
|
INSERT INTO tb_rst_historical_record(
|
|
INSERT INTO tb_rst_historical_record(
|
|
- approval_id
|
|
|
|
- admin_id
|
|
|
|
- record_state
|
|
|
|
- task_id
|
|
|
|
- approval_time
|
|
|
|
|
|
+ approval_id,
|
|
|
|
+ admin_id,
|
|
|
|
+ record_state,
|
|
|
|
+ task_id,
|
|
|
|
+ approval_time,
|
|
record_create_time
|
|
record_create_time
|
|
)
|
|
)
|
|
VALUES
|
|
VALUES
|
|
@@ -250,31 +256,34 @@
|
|
<!--查询审批信息列表-->
|
|
<!--查询审批信息列表-->
|
|
<select id="listApprovalInfo" parameterType="ApprovalInfo" resultMap="ApprovalInfoResultMap">
|
|
<select id="listApprovalInfo" parameterType="ApprovalInfo" resultMap="ApprovalInfoResultMap">
|
|
SELECT
|
|
SELECT
|
|
- ai.approval_id
|
|
|
|
- ai.approval_name
|
|
|
|
- ai.approval_type
|
|
|
|
- ai.approval_status
|
|
|
|
- ai.approval_status_details
|
|
|
|
- ai.admin_id
|
|
|
|
- ai.approval_applicant
|
|
|
|
- ai.activiti_id
|
|
|
|
- ai.approval_details
|
|
|
|
- ai.approval_remark
|
|
|
|
|
|
+ ai.approval_id,
|
|
|
|
+ ai.approval_name,
|
|
|
|
+ ai.approval_type,
|
|
|
|
+ ai.approval_status,
|
|
|
|
+ ai.approval_status_details,
|
|
|
|
+ ai.admin_id,
|
|
|
|
+ ai.approval_applicant,
|
|
|
|
+ ai.activiti_id,
|
|
|
|
+ ai.approval_details,
|
|
|
|
+ ai.approval_remark,
|
|
ai.approval_create_time
|
|
ai.approval_create_time
|
|
from tb_rst_approval_info ai
|
|
from tb_rst_approval_info ai
|
|
LEFT JOIN tb_rst_historical_record hr ON ai.approval_id = hr.approval_id
|
|
LEFT JOIN tb_rst_historical_record hr ON ai.approval_id = hr.approval_id
|
|
<where>
|
|
<where>
|
|
|
|
+ <if test="approvalId != null and approvalId != ''">
|
|
|
|
+ ai.approval_id = #{approvalId}
|
|
|
|
+ </if>
|
|
<if test="adminId != null and adminId != ''">
|
|
<if test="adminId != null and adminId != ''">
|
|
- ai.admin_id = #{adminId}
|
|
|
|
|
|
+ AND ai.admin_id = #{adminId}
|
|
</if>
|
|
</if>
|
|
<if test="approvalType != null and approvalType != ''">
|
|
<if test="approvalType != null and approvalType != ''">
|
|
- ai.approval_type = #{approvalType}
|
|
|
|
|
|
+ AND ai.approval_type = #{approvalType}
|
|
</if>
|
|
</if>
|
|
<if test="approvalStatus != null and approvalStatus != ''">
|
|
<if test="approvalStatus != null and approvalStatus != ''">
|
|
- ai.approval_status = #{approvalStatus}
|
|
|
|
|
|
+ AND ai.approval_status = #{approvalStatus}
|
|
</if>
|
|
</if>
|
|
- <if test="adminId != null and adminId != ''">
|
|
|
|
- hr.admin_id = #{adminId}
|
|
|
|
|
|
+ <if test="approvalAdminId != null and approvalAdminId != ''">
|
|
|
|
+ AND hr.admin_id = #{approvalAdminId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -337,6 +346,9 @@
|
|
api.item_product_model itemProductModel,
|
|
api.item_product_model itemProductModel,
|
|
api.item_product_unit itemProductUnit,
|
|
api.item_product_unit itemProductUnit,
|
|
api.item_product_box_number itemProductBoxNumber,
|
|
api.item_product_box_number itemProductBoxNumber,
|
|
|
|
+ api.item_should_storage itemShouldStorage,
|
|
|
|
+ api.item_actual_storage itemActualStorage,
|
|
|
|
+ api.item_lack_number itemLackNumber,
|
|
api.item_create_time itemCreateTime,
|
|
api.item_create_time itemCreateTime,
|
|
api.item_update_time itemUpdateTime
|
|
api.item_update_time itemUpdateTime
|
|
from tb_rst_approval_production_item api
|
|
from tb_rst_approval_production_item api
|
|
@@ -394,7 +406,7 @@
|
|
hr.admin_id = #{adminId}
|
|
hr.admin_id = #{adminId}
|
|
</if>
|
|
</if>
|
|
<if test="approvalId != null and approvalId != ''">
|
|
<if test="approvalId != null and approvalId != ''">
|
|
- hr.approval_id = #{approvalId}
|
|
|
|
|
|
+ AND hr.approval_id = #{approvalId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -414,7 +426,7 @@
|
|
hr.admin_id = #{adminId}
|
|
hr.admin_id = #{adminId}
|
|
</if>
|
|
</if>
|
|
<if test="approvalId != null and approvalId != ''">
|
|
<if test="approvalId != null and approvalId != ''">
|
|
- hr.approval_id = #{approvalId}
|
|
|
|
|
|
+ AND hr.approval_id = #{approvalId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -433,7 +445,7 @@
|
|
approval_id = #{approvalId}
|
|
approval_id = #{approvalId}
|
|
</if>
|
|
</if>
|
|
<if test="adminId != null and adminId != ''">
|
|
<if test="adminId != null and adminId != ''">
|
|
- admin_id = #{adminId}
|
|
|
|
|
|
+ AND admin_id = #{adminId}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
@@ -447,7 +459,7 @@
|
|
approval_status = #{approvalStatus},
|
|
approval_status = #{approvalStatus},
|
|
</if>
|
|
</if>
|
|
<if test="approvalStatusDetails != null" >
|
|
<if test="approvalStatusDetails != null" >
|
|
- approval_status_details = #{approvalStatusDetails}
|
|
|
|
|
|
+ approval_status_details = #{approvalStatusDetails},
|
|
</if>
|
|
</if>
|
|
<if test="approvalDetails != null" >
|
|
<if test="approvalDetails != null" >
|
|
approval_details = #{approvalDetails}
|
|
approval_details = #{approvalDetails}
|
|
@@ -463,172 +475,44 @@
|
|
<delete id="deleteHistoricalRecord" parameterType="Integer">
|
|
<delete id="deleteHistoricalRecord" parameterType="Integer">
|
|
DELETE FROM tb_rst_historical_record where approval_id = #{approvalId}
|
|
DELETE FROM tb_rst_historical_record where approval_id = #{approvalId}
|
|
</delete>
|
|
</delete>
|
|
- <!-- <resultMap id="BaseResultMap" type="ApprovalOrderInfo" >
|
|
|
|
- <id column="approval_id" property="approvalId" jdbcType="INTEGER" />
|
|
|
|
- <result column="applicant_name" property="applicantName" jdbcType="VARCHAR" />
|
|
|
|
- <result column="applicant_id" property="applicantId" jdbcType="INTEGER" />
|
|
|
|
- <result column="order_name" property="orderName" jdbcType="VARCHAR" />
|
|
|
|
- <result column="company_name" property="companyName" jdbcType="VARCHAR" />
|
|
|
|
- <result column="contact_name" property="contactName" jdbcType="VARCHAR" />
|
|
|
|
- <result column="contact_tel" property="contactTel" jdbcType="VARCHAR" />
|
|
|
|
- <result column="delivery_time" property="deliveryTime" jdbcType="TIMESTAMP" />
|
|
|
|
- <result column="delivery_way" property="deliveryWay" jdbcType="VARCHAR" />
|
|
|
|
- <result column="contract_name" property="contractName" jdbcType="VARCHAR" />
|
|
|
|
- <result column="contract_img" property="contractImg" jdbcType="VARCHAR" />
|
|
|
|
- <result column="attachment_img" property="attachmentImg" jdbcType="VARCHAR" />
|
|
|
|
- <result column="approval_state" property="approvalState" jdbcType="INTEGER" />
|
|
|
|
- <result column="current_admin_id" property="currentAdminId" jdbcType="INTEGER" />
|
|
|
|
- <result column="approval_desc" property="approvalDesc" jdbcType="VARCHAR" />
|
|
|
|
- <result column="approval_create_time" property="approvalCreateTime" jdbcType="TIMESTAMP" />
|
|
|
|
- <result column="approval_update_time" property="approvalUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
|
- <collection property="approvalOrderItemList" column="approval_id" ofType="ApprovalOrderItem" select="listApprovalOrderItem"/>
|
|
|
|
- </resultMap>
|
|
|
|
- <sql id="approval_order_column_List" >
|
|
|
|
- approval_id, applicant_name,applicant_id, order_name,company_name,contact_name,
|
|
|
|
- contact_tel,delivery_time,delivery_way,contract_name,contract_img,attachment_img,approval_state
|
|
|
|
- ,current_admin_id,approval_desc,approval_create_time,approval_update_time
|
|
|
|
- </sql>
|
|
|
|
- <sql id="order_item_column_List" >
|
|
|
|
- item_id, approval_id,product_id, product_name,color_name,product_num,
|
|
|
|
- item_create_time,item_update_time
|
|
|
|
- </sql>
|
|
|
|
- <sql id="approval_people_column_List" >
|
|
|
|
- people_id, approval_name,admin_id,is_first,is_last,next_admin_id
|
|
|
|
- </sql>
|
|
|
|
-
|
|
|
|
- <sql id="approval_record_column_List" >
|
|
|
|
- record_id,approval_name,admin_id,approval_id,record_state,approval_time,approval_desc,record_create_time,record_update_time
|
|
|
|
- </sql>
|
|
|
|
-
|
|
|
|
- <!– 批量添加订单项数据 –>
|
|
|
|
- <insert id="insertItem" parameterType="ArrayList">
|
|
|
|
- INSERT INTO tb_rst_approval_order_item
|
|
|
|
- (
|
|
|
|
- approval_id,
|
|
|
|
- product_id,
|
|
|
|
- product_name,
|
|
|
|
- color_name,
|
|
|
|
- product_num,
|
|
|
|
- item_create_time,
|
|
|
|
- )
|
|
|
|
- VALUES
|
|
|
|
- <foreach collection="list" item="item" separator=",">
|
|
|
|
- (
|
|
|
|
- #{item.approvalId},#{item.productId},#{item.productName},#{item.colorName},
|
|
|
|
- #{item.productNum},#{item.itemCreateTime}
|
|
|
|
- )
|
|
|
|
- </foreach>
|
|
|
|
- </insert>
|
|
|
|
-
|
|
|
|
- <insert id="insertRecord" parameterType="ApprovalRecord">
|
|
|
|
- INSERT INTO tb_rst_approval_order(
|
|
|
|
- approval_name,
|
|
|
|
- admin_id,
|
|
|
|
- record_state,
|
|
|
|
- approval_time,
|
|
|
|
- approval_desc,
|
|
|
|
- record_create_time
|
|
|
|
- )
|
|
|
|
- VALUES
|
|
|
|
- (#{approvalName},
|
|
|
|
- (#{adminId},#{recordState},
|
|
|
|
- #{approvalTime},
|
|
|
|
- #{approvalDesc},
|
|
|
|
- #{recordCreateTime})
|
|
|
|
- </insert>
|
|
|
|
|
|
|
|
- <select id="listApprovalOrderInfo" parameterType="ApprovalOrderInfo" resultMap="BaseResultMap">
|
|
|
|
- SELECT
|
|
|
|
- ao.approval_id,
|
|
|
|
- ao.applicant_name,
|
|
|
|
- ao.applicant_id,
|
|
|
|
- ao.order_name,
|
|
|
|
- ao.company_name,
|
|
|
|
- ao.contact_name,
|
|
|
|
- ao.contact_tel,
|
|
|
|
- ao.delivery_time,
|
|
|
|
- ao.delivery_way,
|
|
|
|
- ao.contract_name,
|
|
|
|
- ao.contract_img,
|
|
|
|
- ao.attachment_img,
|
|
|
|
- ao.approval_state,
|
|
|
|
- ao.current_admin_id,
|
|
|
|
- ao.approval_desc,
|
|
|
|
- ao.approval_create_time,
|
|
|
|
- ao.approval_update_time,
|
|
|
|
- sa.admin_name AS currentAdminName
|
|
|
|
- from tb_rst_approval_order ao
|
|
|
|
- LEFT JOIN tb_rst_sys_admin sa ON ao.current_admin_id = sa.admin_id
|
|
|
|
- <where>
|
|
|
|
- <if test="applicantId != null and applicantId != ''">
|
|
|
|
- ao.applicant_id = #{applicantId}
|
|
|
|
- </if>
|
|
|
|
- <if test="currentAdminId != null and currentAdminId != ''">
|
|
|
|
- OR ao.current_admin_id = #{currentAdminId}
|
|
|
|
- </if>
|
|
|
|
- <if test="approvalState != null and approvalState != ''">
|
|
|
|
- OR ao.approval_state = #{approvalState}
|
|
|
|
- </if>
|
|
|
|
- <if test="approvalId != null and approvalId != ''">
|
|
|
|
- OR ao.approval_id = #{approvalId}
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <select id="listApprovalOrderItem" parameterType="Integer" resultType="ApprovalOrderItem">
|
|
|
|
- SELECT
|
|
|
|
- <include refid="order_item_column_List" />
|
|
|
|
- FROM tb_rst_approval_order_item
|
|
|
|
- WHERE approval_id = #{approvalId}
|
|
|
|
- </select>
|
|
|
|
-
|
|
|
|
- <update id="update" parameterType="ApprovalOrderInfo">
|
|
|
|
- update tb_rst_approval_order
|
|
|
|
|
|
+ <!-- 修改审批订单项-->
|
|
|
|
+ <update id="updateProductionItem" parameterType="ApprovalProductionItem">
|
|
|
|
+ update tb_rst_approval_production_item
|
|
<set >
|
|
<set >
|
|
- <if test="applicantName != null" >
|
|
|
|
- applicant_name = #{applicantName},
|
|
|
|
- </if>
|
|
|
|
- <if test="applicantId != null" >
|
|
|
|
- applicant_id = #{applicantId},
|
|
|
|
- </if>
|
|
|
|
- <if test="orderName != null" >
|
|
|
|
- order_name = #{orderName},
|
|
|
|
|
|
+ <if test="itemShouldStorage != null" >
|
|
|
|
+ item_should_storage = #{itemShouldStorage},
|
|
</if>
|
|
</if>
|
|
- <if test="companyName != null" >
|
|
|
|
- company_name = #{companyName},
|
|
|
|
|
|
+ <if test="itemActualStorage != null" >
|
|
|
|
+ item_actual_storage = #{itemActualStorage},
|
|
</if>
|
|
</if>
|
|
- <if test="contactTel != null" >
|
|
|
|
- contact_tel = #{contactTel},
|
|
|
|
- </if>
|
|
|
|
- <if test="deliveryTime != null" >
|
|
|
|
- delivery_time = #{deliveryTime},
|
|
|
|
- </if>
|
|
|
|
- <if test="deliveryWay != null" >
|
|
|
|
- delivery_way = #{deliveryWay},
|
|
|
|
- </if>
|
|
|
|
- <if test="contractName != null" >
|
|
|
|
- contract_name = #{contractName},
|
|
|
|
- </if>
|
|
|
|
- <if test="contractImg != null" >
|
|
|
|
- contract_img = #{contractImg},
|
|
|
|
- </if>
|
|
|
|
- <if test="attachmentImg != null" >
|
|
|
|
- attachment_img = #{attachmentImg},
|
|
|
|
- </if>
|
|
|
|
- <if test="approvalState != null" >
|
|
|
|
- approval_state = #{approvalState},
|
|
|
|
- </if>
|
|
|
|
- <if test="currentAdminId != null" >
|
|
|
|
- current_admin_id = #{currentAdminId},
|
|
|
|
- </if>
|
|
|
|
- <if test="approvalDesc != null" >
|
|
|
|
- approval_desc = #{approvalDesc}
|
|
|
|
|
|
+ <if test="itemLackNumber != null" >
|
|
|
|
+ item_lack_number = #{itemLackNumber}
|
|
</if>
|
|
</if>
|
|
</set>
|
|
</set>
|
|
- where approval_id = #{approvalId}
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="itemId != null and itemId != ''">
|
|
|
|
+ item_id = #{itemId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
- <delete id="deleteItem" parameterType="Integer">
|
|
|
|
- DELETE FROM tb_rst_approval_order_item where approval_id = #{approvalId}
|
|
|
|
- </delete>-->
|
|
|
|
|
|
+ <!-- 添加仓库入库记录-->
|
|
|
|
+ <insert id="insertInventoryRecords" parameterType="ApprovalInventoryRecords">
|
|
|
|
+ INSERT INTO tb_rst_approval_inventory_records(
|
|
|
|
+ approval_id,
|
|
|
|
+ storage_state,
|
|
|
|
+ product_id,
|
|
|
|
+ product_name,
|
|
|
|
+ color_name,
|
|
|
|
+ should_storage,
|
|
|
|
+ actual_storage,
|
|
|
|
+ lack_number,
|
|
|
|
+ operating_admin_id,
|
|
|
|
+ operating_time
|
|
|
|
+ )
|
|
|
|
+ VALUES
|
|
|
|
+ (#{approvalId},#{storageState},#{productId}
|
|
|
|
+ ,#{productName},#{colorName},#{shouldStorage}
|
|
|
|
+ ,#{actualStorage},#{lackNumber},#{operatingAdminId},NOW())
|
|
|
|
+ </insert>
|
|
</mapper>
|
|
</mapper>
|