Commit e4dd5d12 by yinyong

数据中心--采购明细增加是否aims状态

parent 6da309c0
...@@ -20,4 +20,4 @@ RUN cd /usr/app/data-parent && mvn -T 1C install -pl ../data-base/base-sync-pur ...@@ -20,4 +20,4 @@ RUN cd /usr/app/data-parent && mvn -T 1C install -pl ../data-base/base-sync-pur
#指定容器启动程序及参数 <ENTRYPOINT> "<CMD>" #指定容器启动程序及参数 <ENTRYPOINT> "<CMD>"
EXPOSE 8080 EXPOSE 8080
ENTRYPOINT ["java","-Xms80m","-Xmx200m","-jar","/usr/app/data-base/base-sync-purchase-details/target/base-sync-purchase-details-1.0-SNAPSHOT.jar"] ENTRYPOINT ["java","-Xms80m","-Xmx300m","-jar","/usr/app/data-base/base-sync-purchase-details/target/base-sync-purchase-details-1.0-SNAPSHOT.jar"]
\ No newline at end of file \ No newline at end of file
...@@ -26,6 +26,7 @@ public class Application { ...@@ -26,6 +26,7 @@ public class Application {
public static void main(String[] args) { public static void main(String[] args) {
new JobScheduler(createRegistryCenter(), createJobConfiguration()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init(); new JobScheduler(createRegistryCenter(), createJobConfiguration1()).init();
new JobScheduler(createRegistryCenter(), createJobConfiguration2()).init();
} }
private static CoordinatorRegistryCenter createRegistryCenter() { private static CoordinatorRegistryCenter createRegistryCenter() {
...@@ -48,6 +49,13 @@ public class Application { ...@@ -48,6 +49,13 @@ public class Application {
return simpleJobRootConfig; return simpleJobRootConfig;
} }
private static LiteJobConfiguration createJobConfiguration2() {
JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder(propertiesUtil.getPropertyAsString("AIMS_JOB_NAME"), propertiesUtil.getPropertyAsString("AIMS_JOB_CRON"), propertiesUtil.getPropertyAsInt("SHARDING_TOTAL_COUNT")).build();
SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, SyncPurchaseAimsJob.class.getCanonicalName());
LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();
return simpleJobRootConfig;
}
private static JobEventConfiguration createJobEventConfiguration() { private static JobEventConfiguration createJobEventConfiguration() {
JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource()); JobEventConfiguration jobEventRdbConfig = new JobEventRdbConfiguration(setUpEventTraceDataSource());
return jobEventRdbConfig; return jobEventRdbConfig;
......
...@@ -351,6 +351,9 @@ public class PurchaseDetailDTO { ...@@ -351,6 +351,9 @@ public class PurchaseDetailDTO {
@JSONField(name = "isallot") @JSONField(name = "isallot")
private Integer isallot; private Integer isallot;
@JSONField(name = "isaims")
private Integer isaims;
@JSONField(name = "detail_delstatus") @JSONField(name = "detail_delstatus")
private Boolean detailDelstatus; private Boolean detailDelstatus;
......
package com.bailuntec.job;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.bailuntec.domain.constant.CommonConstant;
import com.bailuntec.domain.dto.PurchaseDetailAimsDTO;
import com.bailuntec.domain.dto.PurchaseDetailDTO;
import com.bailuntec.domain.entity.DcBasePurchaseDetails;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBasePurchaseDetailsExample;
import com.bailuntec.mapper.DcBasePurchaseDetailsMapper;
import com.bailuntec.mapper.JobPointLogMapper;
import com.bailuntec.support.PointJob;
import com.bailuntec.utils.OkHttpUtil;
import com.bailuntec.utils.PropertiesUtil;
import com.bailuntec.utils.SessionUtil;
import com.dangdang.ddframe.job.api.ShardingContext;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
@Slf4j
public class SyncPurchaseAimsJob extends PointJob {
private static PropertiesUtil propertiesUtil = PropertiesUtil.getInstance("const");
private static OkHttpClient client = OkHttpUtil.getInstance();
@Override
public void executeJob(ShardingContext shardingContext, JobPointLog jobPointLog) {
Integer pageSize = jobPointLog.getPageSize();
jobPointLog.setPageIndex(jobPointLog.getPageIndex() != 1 ? 1 : jobPointLog.getPageIndex());
DcBasePurchaseDetailsMapper dcBasePurchaseDetailsMapper = SessionUtil.getSession().getMapper(DcBasePurchaseDetailsMapper.class);
long count = 0L;
try{
count = dcBasePurchaseDetailsMapper.getCount();
}catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败");
} finally {
SessionUtil.closeSession();
}
int totalPage = (int)(count % pageSize.longValue() == 0 ? count/pageSize.longValue() : count/pageSize.longValue() + 1);
do{
dcBasePurchaseDetailsMapper = SessionUtil.getSession().getMapper(DcBasePurchaseDetailsMapper.class);
List<String> dcBasePurchaseDetailsList = dcBasePurchaseDetailsMapper.selectPageByGroup((jobPointLog.getPageIndex() - 1) * jobPointLog.getPageSize(), jobPointLog.getPageSize());
MediaType mediaType = MediaType.parse("application/json");
LinkedHashMap<String, Object> map = new LinkedHashMap<>(1);
map.put("purchasenos", String.join(",", dcBasePurchaseDetailsList));
List<PurchaseDetailAimsDTO> purchaseDetailAimsDTOS = null;
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
String purchaseStr = null;
Response response = null;
if (purchaseDetailAimsDTOS != null) purchaseDetailAimsDTOS = null;
try {
Request request = new Request.Builder()
.url(propertiesUtil.getPropertyAsString("PURCHASE_AIMS_URL"))
.post(body)
.addHeader("Content-Type", "application/json")
.build();
response = client.newCall(request).execute();
purchaseStr = response.body().string();
System.out.println(purchaseStr);
} catch (IOException e) {
log.error("调用采购单sku详细信息接口失败", e);
throw new RuntimeException("调用采购单sku详细信息接口失败", e);
} finally {
if (response != null) {
response.close();
}
}
if (StringUtils.isNotBlank(purchaseStr)) {
JSONObject jsonObject = JSON.parseObject(purchaseStr);
if (jsonObject != null) {
purchaseDetailAimsDTOS = jsonObject.getObject("list", new TypeReference<List<PurchaseDetailAimsDTO>>() {
});
if (purchaseDetailAimsDTOS != null && purchaseDetailAimsDTOS.size() > 0) {
dcBasePurchaseDetailsMapper = SessionUtil.getSession().getMapper(DcBasePurchaseDetailsMapper.class);
try {
for(PurchaseDetailAimsDTO purchaseDetailAimsDTO : purchaseDetailAimsDTOS) {
dcBasePurchaseDetailsMapper.updateByBuyNo(purchaseDetailAimsDTO.getIsaims(), purchaseDetailAimsDTO.getPurchaseId());
}
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败");
}finally {
SessionUtil.closeSession();
}
}
}else {
throw new RuntimeException("调用采购单sku详细信息接口失败");
}
} else {
throw new RuntimeException("调用采购单sku详细信息接口失败");
}
jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1);
}while (jobPointLog.getPageIndex() <= totalPage);
jobPointLog.setPageIndex(1);
jobPointLog.setGmtModified(LocalDateTime.now());
jobPointLog.setStartTime(jobPointLog.getEndTime());
jobPointLog.setEndTime(jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()).isAfter(LocalDateTime.now()) ? LocalDateTime.now() : jobPointLog.getStartTime().plusDays(jobPointLog.getIntervalTime().longValue()));
}
}
#PURCHASE_DETAILS_URL=http://purchase.bailuntec.com/api/GetPagePurchaseSkuInfo #PURCHASE_DETAILS_URL=http://purchase.bailuntec.com/api/GetPagePurchaseSkuInfo
SEMI_PURCHASE_DETAILS_URL=http://mjcg.bailuntec.com/Api/GetPagePurchaseSkuInfo SEMI_PURCHASE_DETAILS_URL=http://mjcg.bailuntec.com/Api/GetPagePurchaseSkuInfo
PURCHASE_DETAILS_URL=http://10.0.6.15:3333/api/GetPagePurchaseSkuInfo PURCHASE_DETAILS_URL=http://10.0.6.15:3333/api/GetPagePurchaseSkuInfo
PURCHASE_AIMS_URL=http://api.purchase.bailuntec.com/Api/PurchaseSource
\ No newline at end of file
...@@ -12,4 +12,6 @@ JOB_NAME=base-purchase-details ...@@ -12,4 +12,6 @@ JOB_NAME=base-purchase-details
JOB_CRON=0/3 * * * * ? * JOB_CRON=0/3 * * * * ? *
SEMI_JOB_NAME=semi-purchase-details-info SEMI_JOB_NAME=semi-purchase-details-info
SEMI_JOB_CRON=0/3 * * * * ? * SEMI_JOB_CRON=0/3 * * * * ? *
AIMS_JOB_NAME=base-purchase-details-aims
AIMS_JOB_CRON=0 0 12 * * ? *
SHARDING_TOTAL_COUNT=1 SHARDING_TOTAL_COUNT=1
\ No newline at end of file
import com.bailuntec.domain.entity.JobPointLog; import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.job.SyncPurchaseAimsJob;
import com.bailuntec.job.SyncPurchaseDetailsJob; import com.bailuntec.job.SyncPurchaseDetailsJob;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
...@@ -13,4 +14,12 @@ public class SyncPurchaseDetailsTest { ...@@ -13,4 +14,12 @@ public class SyncPurchaseDetailsTest {
LocalDateTime.of(2018,12,26,0,0))); LocalDateTime.of(2018,12,26,0,0)));
} }
@Test
public void test1() {
SyncPurchaseAimsJob syncPurchaseAimsJob = new SyncPurchaseAimsJob();
syncPurchaseAimsJob.executeJob(null, new JobPointLog("test", 1, 100, 0, 1,
LocalDateTime.of(2018,12,25,0,0),
LocalDateTime.of(2018,12,26,0,0)));
}
} }
package com.bailuntec.domain.dto;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class PurchaseDetailAimsDTO {
@JSONField(name = "buyno")
private String purchaseId;
@JSONField(name = "isaims")
private Integer isaims;
}
...@@ -377,6 +377,15 @@ public class DcBasePurchaseDetails { ...@@ -377,6 +377,15 @@ public class DcBasePurchaseDetails {
private Integer isallot; private Integer isallot;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_purchase_details.isaims
*
* @mbg.generated
*/
private Integer isaims;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_purchase_details * This method corresponds to the database table dc_base_purchase_details
* *
...@@ -429,6 +438,7 @@ public class DcBasePurchaseDetails { ...@@ -429,6 +438,7 @@ public class DcBasePurchaseDetails {
sb.append(", companyId=").append(companyId); sb.append(", companyId=").append(companyId);
sb.append(", ispush=").append(ispush); sb.append(", ispush=").append(ispush);
sb.append(", isallot=").append(isallot); sb.append(", isallot=").append(isallot);
sb.append(", isaims=").append(isaims);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -491,7 +501,8 @@ public class DcBasePurchaseDetails { ...@@ -491,7 +501,8 @@ public class DcBasePurchaseDetails {
&& (this.getLogisticsCompanyName() == null ? other.getLogisticsCompanyName() == null : this.getLogisticsCompanyName().equals(other.getLogisticsCompanyName())) && (this.getLogisticsCompanyName() == null ? other.getLogisticsCompanyName() == null : this.getLogisticsCompanyName().equals(other.getLogisticsCompanyName()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getIspush() == null ? other.getIspush() == null : this.getIspush().equals(other.getIspush())) && (this.getIspush() == null ? other.getIspush() == null : this.getIspush().equals(other.getIspush()))
&& (this.getIsallot() == null ? other.getIsallot() == null : this.getIsallot().equals(other.getIsallot())); && (this.getIsallot() == null ? other.getIsallot() == null : this.getIsallot().equals(other.getIsallot()))
&& (this.getIsaims() == null ? other.getIsaims() == null : this.getIsaims().equals(other.getIsaims()));
} }
/** /**
...@@ -545,6 +556,7 @@ public class DcBasePurchaseDetails { ...@@ -545,6 +556,7 @@ public class DcBasePurchaseDetails {
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getIspush() == null) ? 0 : getIspush().hashCode()); result = prime * result + ((getIspush() == null) ? 0 : getIspush().hashCode());
result = prime * result + ((getIsallot() == null) ? 0 : getIsallot().hashCode()); result = prime * result + ((getIsallot() == null) ? 0 : getIsallot().hashCode());
result = prime * result + ((getIsaims() == null) ? 0 : getIsaims().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -2970,6 +2970,66 @@ public class DcBasePurchaseDetailsExample { ...@@ -2970,6 +2970,66 @@ public class DcBasePurchaseDetailsExample {
addCriterion("isallot not between", value1, value2, "isallot"); addCriterion("isallot not between", value1, value2, "isallot");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIsaimsIsNull() {
addCriterion("isaims is null");
return (Criteria) this;
}
public Criteria andIsaimsIsNotNull() {
addCriterion("isaims is not null");
return (Criteria) this;
}
public Criteria andIsaimsEqualTo(Integer value) {
addCriterion("isaims =", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsNotEqualTo(Integer value) {
addCriterion("isaims <>", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsGreaterThan(Integer value) {
addCriterion("isaims >", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsGreaterThanOrEqualTo(Integer value) {
addCriterion("isaims >=", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsLessThan(Integer value) {
addCriterion("isaims <", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsLessThanOrEqualTo(Integer value) {
addCriterion("isaims <=", value, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsIn(List<Integer> values) {
addCriterion("isaims in", values, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsNotIn(List<Integer> values) {
addCriterion("isaims not in", values, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsBetween(Integer value1, Integer value2) {
addCriterion("isaims between", value1, value2, "isaims");
return (Criteria) this;
}
public Criteria andIsaimsNotBetween(Integer value1, Integer value2) {
addCriterion("isaims not between", value1, value2, "isaims");
return (Criteria) this;
}
} }
/** /**
......
package com.bailuntec.mapper; package com.bailuntec.mapper;
import com.bailuntec.domain.dto.PurchaseDetailAimsDTO;
import com.bailuntec.domain.entity.DcBasePurchaseDetails; import com.bailuntec.domain.entity.DcBasePurchaseDetails;
import com.bailuntec.domain.example.DcBasePurchaseDetailsExample; import com.bailuntec.domain.example.DcBasePurchaseDetailsExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -121,4 +122,10 @@ public interface DcBasePurchaseDetailsMapper { ...@@ -121,4 +122,10 @@ public interface DcBasePurchaseDetailsMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
int upsertSelective(DcBasePurchaseDetails record); int upsertSelective(DcBasePurchaseDetails record);
long getCount();
List<String> selectPageByGroup(@Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize);
int updateByBuyNo(@Param("isaims") int isaims, @Param("purchaseId") String purchaseId);
} }
\ No newline at end of file
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<result column="company_id" jdbcType="INTEGER" property="companyId" /> <result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="ispush" jdbcType="INTEGER" property="ispush" /> <result column="ispush" jdbcType="INTEGER" property="ispush" />
<result column="isallot" jdbcType="TINYINT" property="isallot" /> <result column="isallot" jdbcType="TINYINT" property="isallot" />
<result column="isaims" jdbcType="INTEGER" property="isaims" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -126,7 +127,7 @@ ...@@ -126,7 +127,7 @@
quantity_not_arrival, quantity_inspect, quantity_qualified_inspect, quantity_unqualified_inspect, quantity_not_arrival, quantity_inspect, quantity_qualified_inspect, quantity_unqualified_inspect,
quantity_wait_transfer, quantity_exchange, quantity_lose_inbound, create_time, update_time, quantity_wait_transfer, quantity_exchange, quantity_lose_inbound, create_time, update_time,
gmt_create, gmt_modified, quantity_not_inbound, alibaba_order_id, logistics_order_id, gmt_create, gmt_modified, quantity_not_inbound, alibaba_order_id, logistics_order_id,
logistics_company_name, company_id, ispush, isallot logistics_company_name, company_id, ispush, isallot, isaims
</sql> </sql>
<select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -201,8 +202,8 @@ ...@@ -201,8 +202,8 @@
create_time, update_time, gmt_create, create_time, update_time, gmt_create,
gmt_modified, quantity_not_inbound, alibaba_order_id, gmt_modified, quantity_not_inbound, alibaba_order_id,
logistics_order_id, logistics_company_name, logistics_order_id, logistics_company_name,
company_id, ispush, isallot company_id, ispush, isallot,
) isaims)
values (#{id,jdbcType=INTEGER}, #{purchaseId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, values (#{id,jdbcType=INTEGER}, #{purchaseId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{purchaseCategoryName,jdbcType=VARCHAR}, #{deliverId,jdbcType=INTEGER}, #{deliverName,jdbcType=VARCHAR}, #{purchaseCategoryName,jdbcType=VARCHAR}, #{deliverId,jdbcType=INTEGER}, #{deliverName,jdbcType=VARCHAR},
#{deliverValue,jdbcType=INTEGER}, #{buyerName,jdbcType=VARCHAR}, #{warehouseFromCode,jdbcType=VARCHAR}, #{deliverValue,jdbcType=INTEGER}, #{buyerName,jdbcType=VARCHAR}, #{warehouseFromCode,jdbcType=VARCHAR},
...@@ -217,8 +218,8 @@ ...@@ -217,8 +218,8 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{gmtCreate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{gmtCreate,jdbcType=TIMESTAMP},
#{gmtModified,jdbcType=TIMESTAMP}, #{quantityNotInbound,jdbcType=INTEGER}, #{alibabaOrderId,jdbcType=VARCHAR}, #{gmtModified,jdbcType=TIMESTAMP}, #{quantityNotInbound,jdbcType=INTEGER}, #{alibabaOrderId,jdbcType=VARCHAR},
#{logisticsOrderId,jdbcType=VARCHAR}, #{logisticsCompanyName,jdbcType=VARCHAR}, #{logisticsOrderId,jdbcType=VARCHAR}, #{logisticsCompanyName,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER}, #{ispush,jdbcType=INTEGER}, #{isallot,jdbcType=TINYINT} #{companyId,jdbcType=INTEGER}, #{ispush,jdbcType=INTEGER}, #{isallot,jdbcType=TINYINT},
) #{isaims,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails"> <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails">
<!-- <!--
...@@ -350,6 +351,9 @@ ...@@ -350,6 +351,9 @@
<if test="isallot != null"> <if test="isallot != null">
isallot, isallot,
</if> </if>
<if test="isaims != null">
isaims,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -475,6 +479,9 @@ ...@@ -475,6 +479,9 @@
<if test="isallot != null"> <if test="isallot != null">
#{isallot,jdbcType=TINYINT}, #{isallot,jdbcType=TINYINT},
</if> </if>
<if test="isaims != null">
#{isaims,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultType="java.lang.Long">
...@@ -617,6 +624,9 @@ ...@@ -617,6 +624,9 @@
<if test="record.isallot != null"> <if test="record.isallot != null">
isallot = #{record.isallot,jdbcType=TINYINT}, isallot = #{record.isallot,jdbcType=TINYINT},
</if> </if>
<if test="record.isaims != null">
isaims = #{record.isaims,jdbcType=INTEGER},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -668,7 +678,8 @@ ...@@ -668,7 +678,8 @@
logistics_company_name = #{record.logisticsCompanyName,jdbcType=VARCHAR}, logistics_company_name = #{record.logisticsCompanyName,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER}, company_id = #{record.companyId,jdbcType=INTEGER},
ispush = #{record.ispush,jdbcType=INTEGER}, ispush = #{record.ispush,jdbcType=INTEGER},
isallot = #{record.isallot,jdbcType=TINYINT} isallot = #{record.isallot,jdbcType=TINYINT},
isaims = #{record.isaims,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -800,6 +811,9 @@ ...@@ -800,6 +811,9 @@
<if test="isallot != null"> <if test="isallot != null">
isallot = #{isallot,jdbcType=TINYINT}, isallot = #{isallot,jdbcType=TINYINT},
</if> </if>
<if test="isaims != null">
isaims = #{isaims,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -848,7 +862,8 @@ ...@@ -848,7 +862,8 @@
logistics_company_name = #{logisticsCompanyName,jdbcType=VARCHAR}, logistics_company_name = #{logisticsCompanyName,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}, company_id = #{companyId,jdbcType=INTEGER},
ispush = #{ispush,jdbcType=INTEGER}, ispush = #{ispush,jdbcType=INTEGER},
isallot = #{isallot,jdbcType=TINYINT} isallot = #{isallot,jdbcType=TINYINT},
isaims = #{isaims,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails"> <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails">
...@@ -982,6 +997,9 @@ ...@@ -982,6 +997,9 @@
<if test="isallot != null"> <if test="isallot != null">
isallot, isallot,
</if> </if>
<if test="isaims != null">
isaims,
</if>
</trim> </trim>
values values
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -1108,6 +1126,9 @@ ...@@ -1108,6 +1126,9 @@
<if test="isallot != null"> <if test="isallot != null">
#{isallot,jdbcType=TINYINT}, #{isallot,jdbcType=TINYINT},
</if> </if>
<if test="isaims != null">
#{isaims,jdbcType=INTEGER},
</if>
</trim> </trim>
on duplicate key update on duplicate key update
<trim suffixOverrides=","> <trim suffixOverrides=",">
...@@ -1234,6 +1255,9 @@ ...@@ -1234,6 +1255,9 @@
<if test="isallot != null"> <if test="isallot != null">
isallot = #{isallot,jdbcType=TINYINT}, isallot = #{isallot,jdbcType=TINYINT},
</if> </if>
<if test="isaims != null">
isaims = #{isaims,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails"> <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBasePurchaseDetails">
...@@ -1250,7 +1274,8 @@ ...@@ -1250,7 +1274,8 @@
quantity_not_arrival, quantity_inspect, quantity_qualified_inspect, quantity_unqualified_inspect, quantity_not_arrival, quantity_inspect, quantity_qualified_inspect, quantity_unqualified_inspect,
quantity_wait_transfer, quantity_exchange, quantity_lose_inbound, create_time, quantity_wait_transfer, quantity_exchange, quantity_lose_inbound, create_time,
update_time, gmt_create, gmt_modified, quantity_not_inbound, alibaba_order_id, update_time, gmt_create, gmt_modified, quantity_not_inbound, alibaba_order_id,
logistics_order_id, logistics_company_name, company_id, ispush, isallot) logistics_order_id, logistics_company_name, company_id, ispush, isallot, isaims
)
values values
(#{id,jdbcType=INTEGER}, #{purchaseId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, (#{id,jdbcType=INTEGER}, #{purchaseId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
#{purchaseCategoryName,jdbcType=VARCHAR}, #{deliverId,jdbcType=INTEGER}, #{deliverName,jdbcType=VARCHAR}, #{purchaseCategoryName,jdbcType=VARCHAR}, #{deliverId,jdbcType=INTEGER}, #{deliverName,jdbcType=VARCHAR},
...@@ -1266,8 +1291,8 @@ ...@@ -1266,8 +1291,8 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{gmtCreate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{gmtCreate,jdbcType=TIMESTAMP},
#{gmtModified,jdbcType=TIMESTAMP}, #{quantityNotInbound,jdbcType=INTEGER}, #{alibabaOrderId,jdbcType=VARCHAR}, #{gmtModified,jdbcType=TIMESTAMP}, #{quantityNotInbound,jdbcType=INTEGER}, #{alibabaOrderId,jdbcType=VARCHAR},
#{logisticsOrderId,jdbcType=VARCHAR}, #{logisticsCompanyName,jdbcType=VARCHAR}, #{logisticsOrderId,jdbcType=VARCHAR}, #{logisticsCompanyName,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER}, #{ispush,jdbcType=INTEGER}, #{isallot,jdbcType=TINYINT} #{companyId,jdbcType=INTEGER}, #{ispush,jdbcType=INTEGER}, #{isallot,jdbcType=TINYINT},
) #{isaims,jdbcType=INTEGER})
on duplicate key update on duplicate key update
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
purchase_id = #{purchaseId,jdbcType=VARCHAR}, purchase_id = #{purchaseId,jdbcType=VARCHAR},
...@@ -1309,7 +1334,8 @@ ...@@ -1309,7 +1334,8 @@
logistics_company_name = #{logisticsCompanyName,jdbcType=VARCHAR}, logistics_company_name = #{logisticsCompanyName,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=INTEGER}, company_id = #{companyId,jdbcType=INTEGER},
ispush = #{ispush,jdbcType=INTEGER}, ispush = #{ispush,jdbcType=INTEGER},
isallot = #{isallot,jdbcType=TINYINT} isallot = #{isallot,jdbcType=TINYINT},
isaims = #{isaims,jdbcType=INTEGER}
</insert> </insert>
<select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBasePurchaseDetailsExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -1328,4 +1354,19 @@ ...@@ -1328,4 +1354,19 @@
</if> </if>
limit 1 limit 1
</select> </select>
<select id="getCount" resultType="java.lang.Long">
select count(id) from (select id from dc_base_purchase_details where isaims is null group by purchase_id)a
</select>
<select id="selectPageByGroup" resultType="java.lang.String">
select purchase_id from dc_base_purchase_details
group by purchase_id
order by id asc
limit #{pageIndex}, #{pageSize}
</select>
<update id="updateByBuyNo">
update dc_base_purchase_details set isaims = #{isaims} where purchase_id = #{purchaseId}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment