|
|
@@ -818,4 +818,106 @@
|
|
|
</set>
|
|
|
where into_id = #{intoId}::uuid
|
|
|
</update>
|
|
|
+
|
|
|
+<!-- 采购退货用-->
|
|
|
+ <resultMap id="BaseResultMapInboundReturnResponse" type="com.dk.mdm.model.response.ivt.InboundResponse">
|
|
|
+ <id column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="into_no" property="intoNo"/>
|
|
|
+ <result column="into_type" property="intoType"/>
|
|
|
+ <result column="from_id" property="fromId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="from_no" property="fromNo"/>
|
|
|
+ <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="sup_id" property="supId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="into_status" property="intoStatus"/>
|
|
|
+ <result column="intoing_qty" property="intoingQty"/>
|
|
|
+ <result column="intoing_amt" property="intoingAmt"/>
|
|
|
+ <result column="into_qty" property="intoQty"/>
|
|
|
+ <result column="into_amt" property="intoAmt"/>
|
|
|
+ <result column="wh_id" property="whId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="return_qty" property="returnQty"/>
|
|
|
+ <result column="return_amt" property="returnAmt"/>
|
|
|
+ <result column="into_date" property="intoDate" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="annex_paths" property="annexPaths" typeHandler="JsonTypeHandler"/>
|
|
|
+ <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="receivable_id" property="receivableId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="payable_id" property="payableId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="sup_name" property="supName"/>
|
|
|
+ <result column="into_reason" property="intoReason" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="into_reason_name" property="intoReasonName" />
|
|
|
+ <result column="orgName" property="orgName" />
|
|
|
+ <result column="staff_name" property="staffName" />
|
|
|
+ <result column="contact_phone" property="contactPhone" />
|
|
|
+ <result column="contact_name" property="contactName" />
|
|
|
+ <result column="channel_name" property="channelName" />
|
|
|
+ <result column="cus_from_name" property="cusFromName" />
|
|
|
+ <result column="return_address" property="returnAddress" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Join_Table_Return">
|
|
|
+ Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
|
|
|
+ Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
|
|
|
+ LEFT JOIN sys.t_data_kind tdk ON tdk.kind_code = tpi.into_status
|
|
|
+ LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = tpi.into_type
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
|
|
|
+ </sql>
|
|
|
+<!-- 采购退货用-->
|
|
|
+ <select id="selectByInboundReturnCond" resultMap="BaseResultMapInboundReturnResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
+ ,tmo.org_name
|
|
|
+ ,tmp.sup_name
|
|
|
+ ,tms.staff_name
|
|
|
+ ,tmw.wh_name
|
|
|
+ ,tms1.staff_name as make_staff_name
|
|
|
+ ,sys.f_get_name_i18n(tdktype.kind_name_i18n, 'zh_CN') AS into_type_name
|
|
|
+ ,sys.f_get_name_i18n(tdk.kind_name_i18n, 'zh_CN') AS into_status_name
|
|
|
+ ,tmd.data_value as into_reason_name
|
|
|
+ ,tmp.return_address
|
|
|
+ ,tmp.contact_name
|
|
|
+ ,tmp.contact_phone
|
|
|
+ FROM dkic_b.t_psi_inbound tpi
|
|
|
+ <include refid="Join_Table_Return"/>
|
|
|
+ <include refid="Condition"/>
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!--采购退货用 查询表t_psi_inbound,(条件查询)个数 -->
|
|
|
+ <select id="countByInboundReturnCond" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_psi_inbound tpi
|
|
|
+ <include refid="Join_Table_Return"/>
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
+ <!-- 查看来源单据,总单加明细 采购退货用-->
|
|
|
+ <select id="selectInboundReturnById" resultMap="BaseResultMapInboundReturnResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Response"/>
|
|
|
+ ,tmo.org_name
|
|
|
+ ,tms.staff_name as staff_name
|
|
|
+ ,tms1.staff_name as make_staff_name
|
|
|
+ ,tmp.sup_name
|
|
|
+ ,tmw.wh_name
|
|
|
+ ,tmd.data_value as into_reason_name
|
|
|
+ ,tmp.return_address
|
|
|
+ ,tmp.contact_name
|
|
|
+ ,tmp.contact_phone
|
|
|
+ FROM dkic_b.t_psi_inbound tpi
|
|
|
+ Left join dkic_b.t_mst_org tmo on tmo.org_id = tpi.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = tpi.sup_id
|
|
|
+ Left join dkic_b.t_mst_staff tms on tms.staff_id = tpi.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff tms1 on tms1.staff_id = tpi.make_staff
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
|
|
|
+ WHERE tpi.into_id = #{intoId}::uuid
|
|
|
+ </select>
|
|
|
</mapper>
|