Authored by qianjun

update

... ... @@ -36,27 +36,57 @@
</select>
```
## 根据品牌id获取可用分类或根据品牌id和JIT供应商ID获取可用分类
## 1.根据品牌id获取非JIT供应商的可用分类
## 2.根据品牌id和JIT供应商ID获取可用分类
> 接口名: `/AgreementRest/getAllSortByBrandId`
### 入参
```json
{
"brandId":1550,
}
or
{
"brandId":1550,
"supplierId":"1418"
}
```
-------------------------
|属性名称|类型|例子|说明|
|--------|----|----|----|
|brandId|int|1550|品牌ID|
|supplierId|String|1418|供应商ID(可选)|
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|----|----|
|brandId|int|1550|品牌ID|是|无|
|supplierId|String|1418|供应商ID|可选|无|
---------------------------
### 1. 对应SQL的操作库表(数据库 erp_supplier,表 clause_settlement)
```xml
<select id="selectByBrandId" resultMap="BaseResultMap" parameterType="java.lang.Short">
select
<include refid="Base_Column_List" />
from clause_settlement
where brand_id = #{brandId,jdbcType=SMALLINT}
</select>
```
### 2. 对应SQL的操作库表(数据库 erp_supplier, 表 agreement)
```xml
<select id="selectByAgreementIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from agreement where agreement_id in (${agreementIds})
and agreement_end_time > FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y-%m-%d') and operations != 3 and `status` in (200,500,900)
and end_agreement = 'N' and business_model != 7
</select>
```
### 3. 对应SQL的操作库表(数据库 erp_supplier, 表 agreement)
```xml
<select id="selectByAgreementIdsAndSupplierId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from agreement where agreement_id in (${agreementIds})
and agreement_end_time > FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y-%m-%d') and operations != 3 and `status` in (200,500,900) and end_agreement = 'N'
and supplier_id=#{supplierId,jdbcType=INTEGER}
</select>
```
### 错误编码
-------------------------
|错误码code|消息|说明|
|----------|----|----|
|无|无|无|
### 返回
... ... @@ -64,9 +94,6 @@ or
{
"code": 200,
"data": [
1,
1,
1,
1
],
"message": "可用分类"
... ... @@ -84,12 +111,60 @@ or
}
```
-------------------------
|属性名称|类型|例子|说明|
|--------|----|----|----|
|brandId|int|1550|品牌ID|
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|----|----|
|brandId|int|1550|品牌ID|是|无|
---------------------------
### 1. 对应SQL的操作库表(数据库 erp_supplier,表 clause_settlement)
```xml
<select id="selectByBrandId" resultMap="BaseResultMap" parameterType="java.lang.Short">
select
<include refid="Base_Column_List" />
from clause_settlement
where brand_id = #{brandId,jdbcType=SMALLINT}
</select>
```
### 2. 对应SQL的操作库表(数据库 erp_supplier,表 agreement)
```xml
<select id="selectValidJitSupplierByAgreementId" resultMap="BaseResultMap">
<bind name="size" value="@com.yohobuy.platform.common.util.SqlUtils@getSize(agreementIds)" />
select <include refid="Base_Column_List" />
from agreement
<where>
<if test="agreementIds !=null and size!=0">
agreement_id in
<foreach collection="agreementIds" item="agreementId" open="(" separator="," close=")">
#{agreementId}
</foreach>
</if>
and agreement_end_time > FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y-%m-%d') and
operations != 3 and `status` in (200,500,900) and end_agreement = 'N' and business_model = 7
</where>
</select>
```
### 3. 对应SQL的操作库表(数据库 erp_supplier,表 supplier)
```xml
<select id="selectBySupplierIds" resultMap="BaseResultMap">
<bind name="size" value="@com.yohobuy.platform.common.util.SqlUtils@getSize(supplierIds)" />
select
<include refid="Base_Column_List" />
from supplier
where is_freeze = 'N'
<if test="supplierIds !=null and size!=0">
and id in
<foreach collection="supplierIds" item="supplierId" open="(" close=")" separator=",">
#{supplierId,jdbcType=INTEGER}
</foreach>
</if>
</select>
```
### 错误编码
-------------------------
|错误码code|消息|说明|
|----------|----|----|
|500|品牌无关联的jit供应商|合同结算条款没有|
|500|品牌无关联的jit供应商|合同没有|
|200|品牌关联的jit供应商||
### 返回
```json
... ...