This commit is contained in:
van
2026-04-09 00:09:09 +08:00
parent c9876df3de
commit e94f17973c
50 changed files with 1637 additions and 72 deletions

View File

@@ -0,0 +1,110 @@
<?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.ruoyi.jarvis.mapper.ErpGoofishOrderMapper">
<resultMap id="ErpGoofishOrderResult" type="com.ruoyi.jarvis.domain.ErpGoofishOrder">
<id property="id" column="id"/>
<result property="appKey" column="app_key"/>
<result property="sellerId" column="seller_id"/>
<result property="userName" column="user_name"/>
<result property="orderNo" column="order_no"/>
<result property="orderType" column="order_type"/>
<result property="orderStatus" column="order_status"/>
<result property="refundStatus" column="refund_status"/>
<result property="modifyTime" column="modify_time"/>
<result property="productId" column="product_id"/>
<result property="itemId" column="item_id"/>
<result property="detailJson" column="detail_json"/>
<result property="lastNotifyJson" column="last_notify_json"/>
<result property="jdOrderId" column="jd_order_id"/>
<result property="localWaybillNo" column="local_waybill_no"/>
<result property="shipStatus" column="ship_status"/>
<result property="shipError" column="ship_error"/>
<result property="shipTime" column="ship_time"/>
<result property="shipExpressCode" column="ship_express_code"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="jdThirdPartyOrderNo" column="jd_third_party_order_no"/>
<result property="jdRemark" column="jd_remark"/>
</resultMap>
<sql id="selectJoinVo">
select e.id, e.app_key, e.seller_id, e.user_name, e.order_no, e.order_type, e.order_status, e.refund_status,
e.modify_time, e.product_id, e.item_id, e.detail_json, e.last_notify_json, e.jd_order_id, e.local_waybill_no,
e.ship_status, e.ship_error, e.ship_time, e.ship_express_code, e.create_time, e.update_time,
o.third_party_order_no as jd_third_party_order_no, o.remark as jd_remark
from erp_goofish_order e
left join jd_order o on e.jd_order_id = o.id
</sql>
<select id="selectById" resultMap="ErpGoofishOrderResult">
<include refid="selectJoinVo"/> where e.id = #{id}
</select>
<select id="selectByAppKeyAndOrderNo" resultMap="ErpGoofishOrderResult">
<include refid="selectJoinVo"/> where e.app_key = #{appKey} and e.order_no = #{orderNo} limit 1
</select>
<select id="selectList" parameterType="com.ruoyi.jarvis.domain.ErpGoofishOrder" resultMap="ErpGoofishOrderResult">
<include refid="selectJoinVo"/>
<where>
<if test="appKey != null and appKey != ''">and e.app_key = #{appKey}</if>
<if test="userName != null and userName != ''">and e.user_name like concat('%', #{userName}, '%')</if>
<if test="orderNo != null and orderNo != ''">and e.order_no like concat('%', #{orderNo}, '%')</if>
<if test="orderStatus != null">and e.order_status = #{orderStatus}</if>
<if test="shipStatus != null">and e.ship_status = #{shipStatus}</if>
<if test="jdOrderId != null">and e.jd_order_id = #{jdOrderId}</if>
</where>
order by e.modify_time desc, e.id desc
</select>
<select id="selectPendingShip" resultMap="ErpGoofishOrderResult">
<include refid="selectJoinVo"/>
where e.order_status = 12 and (e.ship_status is null or e.ship_status != 1) and e.jd_order_id is not null
order by e.update_time asc
limit #{limit}
</select>
<insert id="insert" parameterType="com.ruoyi.jarvis.domain.ErpGoofishOrder" useGeneratedKeys="true" keyProperty="id">
insert into erp_goofish_order
(app_key, seller_id, user_name, order_no, order_type, order_status, refund_status, modify_time, product_id, item_id,
detail_json, last_notify_json, jd_order_id, local_waybill_no, ship_status, ship_error, ship_time, ship_express_code,
create_time, update_time)
values
(#{appKey}, #{sellerId}, #{userName}, #{orderNo}, #{orderType}, #{orderStatus}, #{refundStatus}, #{modifyTime}, #{productId}, #{itemId},
#{detailJson}, #{lastNotifyJson}, #{jdOrderId}, #{localWaybillNo}, #{shipStatus}, #{shipError}, #{shipTime}, #{shipExpressCode},
#{createTime}, #{updateTime})
</insert>
<update id="update" parameterType="com.ruoyi.jarvis.domain.ErpGoofishOrder">
update erp_goofish_order
<trim prefix="SET" suffixOverrides=",">
<if test="sellerId != null">seller_id = #{sellerId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="refundStatus != null">refund_status = #{refundStatus},</if>
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="detailJson != null">detail_json = #{detailJson},</if>
<if test="lastNotifyJson != null">last_notify_json = #{lastNotifyJson},</if>
<if test="jdOrderId != null">jd_order_id = #{jdOrderId},</if>
<if test="localWaybillNo != null">local_waybill_no = #{localWaybillNo},</if>
<if test="shipStatus != null">ship_status = #{shipStatus},</if>
<if test="shipError != null">ship_error = #{shipError},</if>
<if test="shipTime != null">ship_time = #{shipTime},</if>
<if test="shipExpressCode != null">ship_express_code = #{shipExpressCode},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<update id="resetShipForRetry">
update erp_goofish_order
set ship_status = 0,
ship_error = null,
update_time = now()
where id = #{id}
</update>
</mapper>

View File

@@ -0,0 +1,78 @@
<?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.ruoyi.jarvis.mapper.ErpOpenConfigMapper">
<resultMap id="ErpOpenConfigResult" type="com.ruoyi.jarvis.domain.ErpOpenConfig">
<id property="id" column="id"/>
<result property="appKey" column="app_key"/>
<result property="appSecret" column="app_secret"/>
<result property="xyUserName" column="xy_user_name"/>
<result property="expressCode" column="express_code"/>
<result property="expressName" column="express_name"/>
<result property="status" column="status"/>
<result property="orderNum" column="order_num"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectVo">
select id, app_key, app_secret, xy_user_name, express_code, express_name, status, order_num,
create_by, create_time, update_by, update_time, remark
from erp_open_config
</sql>
<select id="selectById" resultMap="ErpOpenConfigResult">
<include refid="selectVo"/> where id = #{id}
</select>
<select id="selectByAppKey" resultMap="ErpOpenConfigResult">
<include refid="selectVo"/> where app_key = #{appKey} limit 1
</select>
<select id="selectList" parameterType="com.ruoyi.jarvis.domain.ErpOpenConfig" resultMap="ErpOpenConfigResult">
<include refid="selectVo"/>
<where>
<if test="appKey != null and appKey != ''">and app_key = #{appKey}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="xyUserName != null and xyUserName != ''">and xy_user_name like concat('%', #{xyUserName}, '%')</if>
</where>
order by order_num asc, id asc
</select>
<select id="selectEnabledOrderBySort" resultMap="ErpOpenConfigResult">
<include refid="selectVo"/>
where status = '0'
order by order_num asc, id asc
</select>
<insert id="insert" parameterType="com.ruoyi.jarvis.domain.ErpOpenConfig" useGeneratedKeys="true" keyProperty="id">
insert into erp_open_config
(app_key, app_secret, xy_user_name, express_code, express_name, status, order_num, create_by, create_time, remark)
values
(#{appKey}, #{appSecret}, #{xyUserName}, #{expressCode}, #{expressName}, #{status}, #{orderNum}, #{createBy}, #{createTime}, #{remark})
</insert>
<update id="update" parameterType="com.ruoyi.jarvis.domain.ErpOpenConfig">
update erp_open_config
<trim prefix="SET" suffixOverrides=",">
<if test="appKey != null">app_key = #{appKey},</if>
<if test="appSecret != null">app_secret = #{appSecret},</if>
<if test="xyUserName != null">xy_user_name = #{xyUserName},</if>
<if test="expressCode != null">express_code = #{expressCode},</if>
<if test="expressName != null">express_name = #{expressName},</if>
<if test="status != null">status = #{status},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteById">
delete from erp_open_config where id = #{id}
</delete>
</mapper>