Commit 3778ad59 by xmh

<feat> traffic 添加 company 字段, 添加相关逻辑

1 parent ed354d01
......@@ -62,6 +62,8 @@ public class Traffic extends BaseModel {
private Integer status;
private String company;
private String jsonData;
public Long getId() {
......@@ -296,6 +298,14 @@ public class Traffic extends BaseModel {
this.status = status;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company == null ? null : company.trim();
}
public String getJsonData() {
return jsonData;
}
......
......@@ -2018,6 +2018,76 @@ public class TrafficExample extends BaseExample {
addCriterion("`traffic`.`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCompanyIsNull() {
addCriterion("`traffic`.company is null");
return (Criteria) this;
}
public Criteria andCompanyIsNotNull() {
addCriterion("`traffic`.company is not null");
return (Criteria) this;
}
public Criteria andCompanyEqualTo(String value) {
addCriterion("`traffic`.company =", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotEqualTo(String value) {
addCriterion("`traffic`.company <>", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThan(String value) {
addCriterion("`traffic`.company >", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThanOrEqualTo(String value) {
addCriterion("`traffic`.company >=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThan(String value) {
addCriterion("`traffic`.company <", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThanOrEqualTo(String value) {
addCriterion("`traffic`.company <=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLike(String value) {
addCriterion("`traffic`.company like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotLike(String value) {
addCriterion("`traffic`.company not like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyIn(List<String> values) {
addCriterion("`traffic`.company in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyNotIn(List<String> values) {
addCriterion("`traffic`.company not in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyBetween(String value1, String value2) {
addCriterion("`traffic`.company between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andCompanyNotBetween(String value1, String value2) {
addCriterion("`traffic`.company not between", value1, value2, "company");
return (Criteria) this;
}
}
public static class ColumnContainer extends ColumnContainerBase {
......@@ -2170,5 +2240,10 @@ public class TrafficExample extends BaseExample {
addColumnStr("`traffic`.`status` as `traffic_status` ");
return (ColumnContainer) this;
}
public ColumnContainer hasCompanyColumn() {
addColumnStr("`traffic`.company as traffic_company ");
return (ColumnContainer) this;
}
}
}
\ No newline at end of file
......@@ -349,6 +349,15 @@ public class TrafficVoBase extends Traffic implements VoInterface<Traffic> {
private Integer status_lte;
@JsonIgnore
private Boolean company_null;
@JsonIgnore
private ArrayList<String> company_arr;
@JsonIgnore
private String company_like;
@JsonIgnore
private Boolean jsonData_null;
@JsonIgnore
......@@ -1687,6 +1696,44 @@ public class TrafficVoBase extends Traffic implements VoInterface<Traffic> {
this.getModel().setStatus(status);
}
public Boolean getCompany_null() {
return company_null;
}
public void setCompany_null(Boolean company_null) {
this.company_null = company_null;
}
public ArrayList<String> getCompany_arr() {
return company_arr;
}
public void setCompany_arr(ArrayList<String> company_arr) {
this.company_arr = company_arr;
}
public String getCompany_like() {
return company_like;
}
public void setCompany_like(String company_like) {
this.company_like = company_like;
}
public String getCompany() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getCompany();
}
public void setCompany(String company) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setCompany(company);
}
public Boolean getJsonData_null() {
return jsonData_null;
}
......
......@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.Optional;
/**
* .
......@@ -131,6 +132,14 @@ public class TrafficProcessor implements ItemProcessor<JSONObject, TrafficConten
traffic.setIllegalCode(illegalCode);
}
// 快递外卖品牌
String company = Optional.ofNullable(eventData.getJSONObject("xcycle"))
.map(x -> x.getJSONObject("company"))
.map(x -> x.getString("code"))
.orElse(null);
traffic.setCompany(company);
// todo RefinedFeature
JSONObject refinedFeature = eventData.getJSONObject("RefinedFeature");
if (refinedFeature != null) {
......
......@@ -545,7 +545,22 @@ public abstract class TrafficBaseController extends BaseController<Traffic, Traf
if(trafficVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(trafficVo.getStatus_lte());
}
if(trafficVo.getCompany() != null) {
criteria.andCompanyEqualTo(trafficVo.getCompany());
}
if(trafficVo.getCompany_null() != null) {
if(trafficVo.getCompany_null().booleanValue()) {
criteria.andCompanyIsNull();
} else {
criteria.andCompanyIsNotNull();
}
}
if(trafficVo.getCompany_arr() != null) {
criteria.andCompanyIn(trafficVo.getCompany_arr());
}
if(trafficVo.getCompany_like() != null) {
criteria.andCompanyLike(trafficVo.getCompany_like());
}
return trafficExample;
}
......
......@@ -31,6 +31,7 @@
<result column="traffic_pics" property="pics" />
<result column="traffic_video_name" property="videoName" />
<result column="traffic_status" property="status" />
<result column="traffic_company" property="company" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.fanxing.commons.model.Traffic" extends="BaseResultMapRoot" />
<resultMap id="ResultMapWithBLOBs" type="com.viontech.fanxing.commons.model.Traffic" extends="BaseResultMap" >
......@@ -108,7 +109,7 @@
`traffic`.feature_sun_shield as traffic_feature_sun_shield, `traffic`.xcycle_type as traffic_xcycle_type,
`traffic`.event_id as traffic_event_id, `traffic`.special_type as traffic_special_type,
`traffic`.with_helmet as traffic_with_helmet, `traffic`.pics as traffic_pics, `traffic`.video_name as traffic_video_name,
`traffic`.`status` as `traffic_status`
`traffic`.`status` as `traffic_status`, `traffic`.company as traffic_company
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'TrafficExample')" >
......@@ -198,7 +199,8 @@
feature_pendant, feature_decoration, feature_sun_shield,
xcycle_type, event_id, special_type,
with_helmet, pics, video_name,
`status`, json_data)
`status`, company, json_data
)
values (#{eventTime,jdbcType=TIMESTAMP}, #{unid,jdbcType=VARCHAR}, #{taskId,jdbcType=BIGINT},
#{eventCate,jdbcType=VARCHAR}, #{eventType,jdbcType=VARCHAR}, #{channelUnid,jdbcType=VARCHAR},
#{plateColor,jdbcType=VARCHAR}, #{plateNumber,jdbcType=VARCHAR}, #{locationCode,jdbcType=VARCHAR},
......@@ -208,7 +210,8 @@
#{featurePendant,jdbcType=SMALLINT}, #{featureDecoration,jdbcType=SMALLINT}, #{featureSunShield,jdbcType=SMALLINT},
#{xcycleType,jdbcType=VARCHAR}, #{eventId,jdbcType=VARCHAR}, #{specialType,jdbcType=VARCHAR},
#{withHelmet,jdbcType=INTEGER}, #{pics,jdbcType=VARCHAR}, #{videoName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{jsonData,jdbcType=LONGVARCHAR})
#{status,jdbcType=INTEGER}, #{company,jdbcType=VARCHAR}, #{jsonData,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.viontech.fanxing.commons.model.Traffic" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into `d_traffic`
......@@ -297,6 +300,9 @@
<if test="status != null" >
`status`,
</if>
<if test="company != null" >
company,
</if>
<if test="jsonData != null" >
json_data,
</if>
......@@ -386,6 +392,9 @@
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="company != null" >
#{company,jdbcType=VARCHAR},
</if>
<if test="jsonData != null" >
#{jsonData,jdbcType=LONGVARCHAR},
</if>
......@@ -487,6 +496,9 @@
<if test="record.status != null" >
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.company != null" >
company = #{record.company,jdbcType=VARCHAR},
</if>
<if test="record.jsonData != null" >
json_data = #{record.jsonData,jdbcType=LONGVARCHAR},
</if>
......@@ -526,6 +538,7 @@
`traffic`.pics = #{record.pics,jdbcType=VARCHAR},
`traffic`.video_name = #{record.videoName,jdbcType=VARCHAR},
`traffic`.`status` = #{record.status,jdbcType=INTEGER},
`traffic`.company = #{record.company,jdbcType=VARCHAR},
`traffic`.json_data = #{record.jsonData,jdbcType=LONGVARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
......@@ -561,7 +574,8 @@
with_helmet = #{record.withHelmet,jdbcType=INTEGER},
pics = #{record.pics,jdbcType=VARCHAR},
video_name = #{record.videoName,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER}
`status` = #{record.status,jdbcType=INTEGER},
company = #{record.company,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -650,6 +664,9 @@
<if test="status != null" >
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="company != null" >
company = #{company,jdbcType=VARCHAR},
</if>
<if test="jsonData != null" >
json_data = #{jsonData,jdbcType=LONGVARCHAR},
</if>
......@@ -686,6 +703,7 @@
pics = #{pics,jdbcType=VARCHAR},
video_name = #{videoName,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
company = #{company,jdbcType=VARCHAR},
json_data = #{jsonData,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
and event_time = #{eventTime,jdbcType=TIMESTAMP}
......@@ -718,7 +736,8 @@
with_helmet = #{withHelmet,jdbcType=INTEGER},
pics = #{pics,jdbcType=VARCHAR},
video_name = #{videoName,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER}
`status` = #{status,jdbcType=INTEGER},
company = #{company,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
and event_time = #{eventTime,jdbcType=TIMESTAMP}
</update>
......
......@@ -91,6 +91,7 @@ CREATE TABLE IF NOT EXISTS d_traffic
vehicle_logo VARCHAR(36) COMMENT '车标编码',
illegal_code VARCHAR(36) COMMENT '违法行为',
illegal_state INT COMMENT '违法行为是否可用',
company VARCHAR(36) comment '外卖/快递公司',
feature_annual_inspection_mark SMALLINT DEFAULT 0 COMMENT '年检标',
feature_pendant SMALLINT DEFAULT 0 COMMENT '吊坠',
feature_decoration SMALLINT DEFAULT 0 COMMENT '摆件',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!