下单增加goodsId的入库,查询ordermaster列表接口增加查询条件

This commit is contained in:
donqi 2022-07-04 22:35:02 +08:00
parent cfcdd24c8d
commit 2eda5293f8
5 changed files with 75 additions and 14 deletions

View File

@ -246,6 +246,7 @@ public class OrderController extends BaseController {
orderMaster.setPayStatus(PayStatus.WAIT_PAY.getCode());
orderMaster.setCreateTime(new Date());
orderMaster.setWorkerId(goods.getWorkerId());
orderMaster.setGoodsId(appOrderRequest.getGoodsId());
// orderMaster.setRevTime(DateUtils.parseDate(appOrderRequest.getServerTime(), com.ghy.common.utils.DateUtils.YYYY_MM_DD_HH_MM_SS));
orderMaster.setRemark(appOrderRequest.getRemark());
orderMaster.setExpectTimeStart(DateUtils.parseDate(appOrderRequest.getExpectTimeStart(), com.ghy.common.utils.DateUtils.YYYY_MM_DD_HH_MM_SS));

View File

@ -110,9 +110,14 @@
/* 默认生成时间排序 */
order by create_time
<trim suffixOverrides=",">
<if test="params.createTimeSort != null and params.createTimeSort != ''">
<choose>
<when test="params.createTimeSort != null and params.createTimeSort != ''">
${params.createTimeSort}
</if>
</when>
<otherwise>
desc
</otherwise>
</choose>
</trim>
</select>

View File

@ -65,4 +65,12 @@ public class OrderMaster extends BaseEntity {
private OrderGoods orderGoods;
private Long goodsId;
private Long goodsCategoryId;
private String goodsName;
private Long countryId;
}

View File

@ -42,4 +42,6 @@ public class AppOrderRequest {
// 备注
private String remark;
private Long goodsId;
}

View File

@ -24,6 +24,7 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="goodsId" column="goods_id"/>
</resultMap>
<sql id="selectOrderMaster">
@ -46,39 +47,81 @@
remark
FROM order_master
</sql>
<sql id="selectOrderMasterMoreInfo">
SELECT om.id,
om.dept_id,
om.code,
om.customer_id,
om.address_id,
om.order_type,
om.order_status,
om.pay_type,
om.pay_status,
om.worker_id,
om.pay_time,
om.rev_time,
om.expect_time_start,
om.expect_time_end,
om.create_by,
om.create_time,
om.remark,
om.goods_id
FROM order_master om
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
LEFT JOIN goods g ON g.goods_id = om.goods_id
</sql>
<select id="selectOrderMasterList" parameterType="com.ghy.order.domain.OrderMaster" resultMap="OrderMasterResult">
<include refid="selectOrderMaster"/>
<include refid="selectOrderMasterMoreInfo"/>
<where>
<if test="deptId != null and deptId != 0">
AND dept_id = #{deptId}
AND om.dept_id = #{deptId}
</if>
<if test="code != null and code != ''">
AND `code` LIKE concat('%', #{code}, '%')
AND om.code LIKE concat('%', #{code}, '%')
</if>
<if test="customerId != null and customerId != 0">
AND customer_id = #{customerId}
AND om.customer_id = #{customerId}
</if>
<if test="orderType != null">
AND order_type = #{orderType}
AND om.order_type = #{orderType}
</if>
<if test="orderStatus != null">
AND order_status = #{orderStatus}
AND om.order_status = #{orderStatus}
</if>
<if test="payType != null">
AND pay_type = #{payType}
AND om.pay_type = #{payType}
</if>
<if test="payStatus != null">
AND pay_status = #{payStatus}
AND om.pay_status = #{payStatus}
</if>
<if test="workerId != null and workerId > 0">
AND worker_id = #{workerId}
AND om.worker_id = #{workerId}
</if>
<if test="workerId == -1">
AND worker_id IS NULL
AND om.worker_id IS NULL
</if>
<if test="goodsCategoryId != null">
AND g.dept_goods_category_id = #{goodsCategoryId}
</if>
<if test="goodsName != null and goodsName != ''">
AND g.goods_name like concat('%', #{goodsName}, '%')
</if>
<if test="countryId != null">
AND ca.country_id = #{countryId}
</if>
</where>
order by create_time desc
order by create_time
<trim suffixOverrides=",">
<choose>
<when test="params.createTimeSort != null and params.createTimeSort != ''">
${params.createTimeSort}
</when>
<otherwise>
desc
</otherwise>
</choose>
</trim>
</select>
<select id="selectById" parameterType="long" resultMap="OrderMasterResult">
@ -123,6 +166,7 @@
<if test="code != null and code != ''">code,</if>
<if test="customerId != null and customerId != 0">customer_id,</if>
<if test="addressId != null and addressId != 0">address_id,</if>
<if test="goodsId != null and goodsId != 0">goods_id,</if>
<if test="orderType != null">order_type,</if>
<if test="orderStatus != null">order_status,</if>
<if test="payType != null">pay_type,</if>
@ -140,6 +184,7 @@
<if test="code != null">#{code},</if>
<if test="customerId != null and customerId != 0">#{customerId},</if>
<if test="addressId != null and addressId != 0">#{addressId},</if>
<if test="goodsId != null and goodsId != 0">#{goodsId},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="payType != null">#{payType},</if>