|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<mapper namespace="com.ruoyi.system.mapper.BaseRequisitioningOrderMapper"> |
|
|
|
|
|
|
|
<resultMap type="BaseRequisitioningOrder" id="BaseRequisitioningOrderResult"> |
|
|
|
<resultMap type="BaseRequisitioningOrderVo" id="BaseRequisitioningOrderResult"> |
|
|
|
<result property="requisitioningId" column="requisitioning_id" /> |
|
|
|
<result property="auditStatus" column="audit_status" /> |
|
|
|
<result property="requisitioningStatus" column="requisitioning_status" /> |
|
|
@ -21,27 +21,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="updateTime" column="update_time" /> |
|
|
|
<result property="remark" column="remark" /> |
|
|
|
<result property="useStatus" column="use_status" /> |
|
|
|
<result property="instanceId" column="instance_id" /> |
|
|
|
<result property="instanceType" column="instance_type" /> |
|
|
|
<result property="instanceTypeName" column="instance_type_name" /> |
|
|
|
<result property="submitInstanceId" column="submit_instance_id" /> |
|
|
|
<result property="cancelInstanceId" column="cancel_instance_id" /> |
|
|
|
<result property="restoreInstanceId" column="restore_instance_id"/> |
|
|
|
<result property="applyTitle" column="apply_title" /> |
|
|
|
<result property="applyUser" column="apply_user" /> |
|
|
|
<result property="applyTime" column="apply_time" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectBaseRequisitioningOrderVo"> |
|
|
|
select requisitioning_id, audit_status, requisitioning_status, requisitioning_code, |
|
|
|
correlation_code, material_amount, materialSum, noRmbSum, rmbSum, apply_user, |
|
|
|
create_by, create_time, update_by, update_time, remark, use_status |
|
|
|
create_by, create_time, update_by, update_time, remark, use_status, |
|
|
|
instance_id, instance_type, instance_type_name, submit_instance_id, cancel_instance_id, restore_instance_id, |
|
|
|
apply_title, apply_user, apply_time |
|
|
|
from base_requisitioning_order |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectBaseRequisitioningOrderList" parameterType="BaseRequisitioningOrder" resultMap="BaseRequisitioningOrderResult"> |
|
|
|
<include refid="selectBaseRequisitioningOrderVo"/> |
|
|
|
<where> |
|
|
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
|
|
|
<if test="requisitioningStatus != null and requisitioningStatus != ''"> and requisitioning_status = #{requisitioningStatus}</if> |
|
|
|
<if test="requisitioningCode != null and requisitioningCode != ''"> and requisitioning_code = #{requisitioningCode}</if> |
|
|
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> |
|
|
|
select r.requisitioning_id, r.requisitioning_status, r.requisitioning_code, |
|
|
|
r.correlation_code, r.material_amount, r.materialSum, r.noRmbSum, r.rmbSum, |
|
|
|
r.update_by, r.update_time, r.remark,r.instance_id, p.dict_value as instance_type_name, |
|
|
|
r.instance_type,r.submit_instance_id, r.cancel_instance_id, |
|
|
|
r.restore_instance_id, r.apply_title, r.apply_user, r.apply_time,r.apply_user, |
|
|
|
r.create_by, r.create_time, r.audit_status, r.use_status |
|
|
|
from base_requisitioning_order as r |
|
|
|
left join( |
|
|
|
select dict_value,dict_label from sys_dict_data |
|
|
|
where dict_type = 'processType' |
|
|
|
) as p |
|
|
|
on r.instance_type = p.dict_value |
|
|
|
<where> |
|
|
|
<if test="requisitioningStatus != null and requisitioningStatus != ''"> and r.requisitioning_status = #{requisitioningStatus}</if> |
|
|
|
<if test="requisitioningCode != null and requisitioningCode != ''"> and r.requisitioning_code = #{requisitioningCode}</if> |
|
|
|
<if test="auditStatus!= null and auditStatus != ''"> and r.audit_status = #{auditStatus}</if> |
|
|
|
<if test="useStatus!= null and useStatus != ''"> and r.use_status = #{useStatus}</if> |
|
|
|
<if test="instanceId != null and instanceId != ''"> and r.instance_id = #{instanceId}</if> |
|
|
|
<if test="instanceType != null and instanceType != ''"> and r.instance_type = #{instanceType}</if> |
|
|
|
<if test="submitInstanceId != null and submitInstanceId != ''"> and r.submit_instance_id = #{submitInstanceId}</if> |
|
|
|
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and r.cancel_instance_id = #{cancelInstanceId}</if> |
|
|
|
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and r.restore_instance_id = #{restoreInstanceId}</if> |
|
|
|
<if test="applyTitle != null and applyTitle != ''"> and r.apply_title = #{applyTitle}</if> |
|
|
|
<if test="applyUser != null and applyUser != ''"> and r.apply_user = #{applyUser}</if> |
|
|
|
<if test="applyTime != null "> and r.apply_time = #{applyTime}</if> |
|
|
|
<if test="createBy != null and createBy != ''"> and r.create_by = #{createBy}</if> |
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> |
|
|
|
and create_time between #{params.beginCreateTime} and #{params.endCreateTime} |
|
|
|
and r.create_time between #{params.beginCreateTime} and #{params.endCreateTime} |
|
|
|
</if> |
|
|
|
<if test="params.materialCode != null and params.materialCode != '' or params.materialName !=null and params.materialName != ''"> |
|
|
|
and requisitioning_code in ( |
|
|
|
and r.requisitioning_code in ( |
|
|
|
select quote_id from base_requisitioning_order_child |
|
|
|
<where> |
|
|
|
<if test="params.materialCode != null and params.materialCode != ''"> |
|
|
@ -66,12 +97,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
|
|
|
|
</select> |
|
|
|
<insert id="insertBaseRequisitioningOrder" parameterType="BaseRequisitioningOrder" useGeneratedKeys="true" keyProperty="requisitioningId"> |
|
|
|
insert into base_requisitioning_order |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="auditStatus != null">audit_status,</if> |
|
|
|
<if test="requisitioningStatus != null">requisitioning_status,</if> |
|
|
|
<if test="requisitioningCode != null">requisitioning_code,</if> |
|
|
|
<if test="correlationCode != null">correlation_code,</if> |
|
|
@ -79,16 +108,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="materialSum != null">materialSum,</if> |
|
|
|
<if test="noRmbSum != null">noRmbSum,</if> |
|
|
|
<if test="rmbSum != null">rmbSum,</if> |
|
|
|
<if test="instanceId != null">instance_id,</if> |
|
|
|
<if test="instanceType != null">instance_type,</if> |
|
|
|
<if test="submitInstanceId != null">submit_instance_id,</if> |
|
|
|
<if test="cancelInstanceId != null">cancel_instance_id,</if> |
|
|
|
<if test="restoreInstanceId != null">restore_instance_id,</if> |
|
|
|
<if test="applyTitle != null">apply_title,</if> |
|
|
|
<if test="applyUser != null">apply_user,</if> |
|
|
|
<if test="applyTime != null">apply_time,</if> |
|
|
|
<if test="useStatus != null">use_status,</if> |
|
|
|
<if test="auditStatus != null">audit_status,</if> |
|
|
|
<if test="createBy != null">create_by,</if> |
|
|
|
<if test="createTime != null">create_time,</if> |
|
|
|
<if test="updateBy != null">update_by,</if> |
|
|
|
<if test="updateTime != null">update_time,</if> |
|
|
|
<if test="remark != null">remark,</if> |
|
|
|
<if test="useStatus != null">use_status,</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="auditStatus != null">#{auditStatus},</if> |
|
|
|
<if test="requisitioningStatus != null">#{requisitioningStatus},</if> |
|
|
|
<if test="requisitioningCode != null">#{requisitioningCode},</if> |
|
|
|
<if test="correlationCode != null">#{correlationCode},</if> |
|
|
@ -96,20 +130,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="materialSum != null">#{materialSum},</if> |
|
|
|
<if test="noRmbSum != null">#{noRmbSum},</if> |
|
|
|
<if test="rmbSum != null">#{rmbSum},</if> |
|
|
|
<if test="applyUser != null">#{applyUser},</if> |
|
|
|
<if test="instanceId != null">#{instance_id},</if> |
|
|
|
<if test="instanceType != null">#{instance_type},</if> |
|
|
|
<if test="submitInstanceId != null">#{submit_instance_id},</if> |
|
|
|
<if test="cancelInstanceId != null">#{cancel_instance_id},</if> |
|
|
|
<if test="restoreInstanceId != null">#{restore_instance_id},</if> |
|
|
|
<if test="applyTitle != null">#{apply_title},</if> |
|
|
|
<if test="applyUser != null">#{apply_user},</if> |
|
|
|
<if test="applyTime != null">#{apply_time},</if> |
|
|
|
<if test="useStatus != null">#{use_status},</if> |
|
|
|
<if test="auditStatus != null">#{audit_status},</if> |
|
|
|
<if test="createBy != null">#{createBy},</if> |
|
|
|
<if test="createTime != null">#{createTime},</if> |
|
|
|
<if test="updateBy != null">#{updateBy},</if> |
|
|
|
<if test="updateTime != null">#{updateTime},</if> |
|
|
|
<if test="remark != null">#{remark},</if> |
|
|
|
<if test="useStatus != null">#{useStatus},</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<update id="updateBaseRequisitioningOrder" parameterType="BaseRequisitioningOrder"> |
|
|
|
update base_requisitioning_order |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
|
|
|
<if test="requisitioningStatus != null">requisitioning_status = #{requisitioningStatus},</if> |
|
|
|
<if test="requisitioningCode != null">requisitioning_code = #{requisitioningCode},</if> |
|
|
|
<if test="correlationCode != null">correlation_code = #{correlationCode},</if> |
|
|
@ -117,13 +156,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="materialSum != null">materialSum = #{materialSum},</if> |
|
|
|
<if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if> |
|
|
|
<if test="rmbSum != null">rmbSum = #{rmbSum},</if> |
|
|
|
<if test="applyUser != null">apply_user = #{applyUser},</if> |
|
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
|
<if test="instanceId != null">#{instanceId},</if> |
|
|
|
<if test="instanceType != null">#{instanceType},</if> |
|
|
|
<if test="submitInstanceId != null">#{submitInstanceId},</if> |
|
|
|
<if test="cancelInstanceId != null">#{cancelInstanceId},</if> |
|
|
|
<if test="restoreInstanceId != null">#{restoreInstanceId},</if> |
|
|
|
<if test="applyTitle != null">#{applyTitle},</if> |
|
|
|
<if test="applyUser != null">#{applyUser},</if> |
|
|
|
<if test="applyTime != null">#{applyTime},</if> |
|
|
|
<if test="useStatus != null">#{useStatus},</if> |
|
|
|
<if test="auditStatus != null">#{auditStatus},</if> |
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
|
<if test="useStatus != null">use_status = #{useStatus},</if> |
|
|
|
</trim> |
|
|
|
where requisitioning_id = #{requisitioningId} |
|
|
|
</update> |
|
|
|