getLimitCodeList.md 5.21 KB

获取限购码列表接口

接口名: /limitCode/getLimitCodeList

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
batchNo String 201602161004 限购码批次号 0~12
name String 联调限购码限购商品 限购码批名称 0~255
reqDepartment String 零售运营部/平台运营 申请部门 0~255
status String 1 状态 0:待审核 1:审核通过 2:驳回 3:过期 4:作废 0~1
skn String 51134663 skn 0~255
sku String 102298 sku 0~255

对应SQL的操作库表

 <select id="queryLimitCodeAttachList" resultMap="AttachBaseResultMap" >
    select 
    <include refid="Rename_Base_Column_List" />,
    group_concat(b.sku separator ';') as skus
    from limit_code a left join limit_code_sku b
    on a.batchNo=b.batchNo and a.limit_skn=b.skn 
    where 1=1
    <if test="id != null and id != ''" >
      and a.id = #{id,jdbcType=INTEGER}
    </if>

    <if test="batchNo != null and batchNo != ''" >
      and a.batchNo like '%' #{batchNo,jdbcType=VARCHAR} '%'
    </if>

    <if test="name != null and name != ''" >
      and a.name like '%' #{name,jdbcType=VARCHAR} '%'
    </if>

    <if test="reqDepartment != null and reqDepartment != ''" >
      and a.req_department like '%' #{reqDepartment,jdbcType=VARCHAR} '%'
    </if>

    <if test="status != null and status != ''" >
      and a.status = #{status,jdbcType=VARCHAR}
    </if>

    <if test="skn != null and skn != ''" >
      and a.limit_skn like '%' #{skn,jdbcType=VARCHAR} '%'
    </if>

     <if test="sku != null and sku != ''" >
      and a.batchNo in (select batchNo from limit_code_sku where sku like '%' #{sku,jdbcType=VARCHAR} '%')
    </if>
    GROUP BY a.id
    order by a.create_time desc limit #{offset},#{size}
  </select>

响应码


响应码code 消息 说明
200 获取列表成功.

返回

{
    "code": 200,
    "data": {
        "list": [
            {
                "auditTime": "2016-04-25 19:41:11",
                "batchNo": "2016042519373439",
                "createTime": "2016-04-25 19:37:34",
                "creatorId": 2794,
                "creatorName": "测试账号",
                "describe": "这是一条限购码说明文字",
                "id": 641,
                "limitCodeType": "N",
                "limitDateFrom": "2016-04-25 09:45:00",
                "limitDateTo": "2016-04-28 10:50:00",
                "limitInfo": "",
                "limitSkn": "500011",
                "limitTimes": 1,
                "name": "这是一条sku限购码测试",
                "reason": "",
                "reqDepartment": "零售部/营销策划",
                "skuTimes": "9;3",
                "skus": "102009;102010",
                "status": 1,
                "userTypeLimit": "新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",
                "userUseLimit": 1
            },
            {
                "auditTime": "",
                "batchNo": "2016042217362497",
                "createTime": "2016-04-25 19:22:27",
                "creatorId": 2794,
                "creatorName": "测试账号",
                "describe": "wstydddd",
                "id": 629,
                "limitCodeType": "N",
                "limitDateFrom": "2016-03-28 00:00:00",
                "limitDateTo": "2016-04-30 11:55:00",
                "limitInfo": "",
                "limitSkn": "321",
                "limitTimes": 1,
                "name": "3213",
                "reason": "",
                "reqDepartment": "零售部/营销策划",
                "skuTimes": "1",
                "skus": "1",
                "status": 1,
                "userTypeLimit": "新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",
                "userUseLimit": 1
            },
            {
                "auditTime": "",
                "batchNo": "2016042216342022",
                "createTime": "2016-04-22 16:34:20",
                "creatorId": 2794,
                "creatorName": "测试账号",
                "describe": "搜到的",
                "id": 623,
                "limitCodeType": "N",
                "limitDateFrom": "2016-04-04 00:00:00",
                "limitDateTo": "2016-04-30 11:55:00",
                "limitInfo": "",
                "limitSkn": "321",
                "limitTimes": 1,
                "name": "3213",
                "reason": "",
                "reqDepartment": "零售部/营销策划",
                "skuTimes": "",
                "skus": "",
                "status": 0,
                "userTypeLimit": "新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",
                "userUseLimit": 1
            }
        ],
        "page": 1,
        "size": 20,
        "total": 549,
        "totalPage": 28
    },
    "md5": "7e614860abe3919b4d13248436b34224",
    "message": "获取列表成功."
}