Browse Source

20201216测试

recovery
zy_Java 5 years ago
parent
commit
b9e1c79c50
  1. 41
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/Message/CarRecordMessageDto.java
  2. 11
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java
  3. 60
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java
  4. 11
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java
  5. 60
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java
  6. 7
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java
  7. 2
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RfidVo.java
  8. 16
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/StepVo.java
  9. 5
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/StepDao.java
  10. 64
      wisdomcar/src/main/java/com/ccsens/wisdomcar/rabbitMQ/RabbitController.java
  11. 44
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
  12. 4
      wisdomcar/src/main/resources/application.yml
  13. 10
      wisdomcar/src/main/resources/mapper_dao/StepDao.xml
  14. 27
      wisdomcar/src/main/resources/mapper_raw/FirstAidRecordMapper.xml
  15. 25
      wisdomcar/src/main/resources/mapper_raw/StepMapper.xml

41
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/Message/CarRecordMessageDto.java

@ -10,11 +10,15 @@ public class CarRecordMessageDto {
/**
* 平车编号
*/
private String carNumber;
private String authId;
/**
* 类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8溶栓 9团注 10维持
*/
private byte type;
/**
*
*/
private int addr;
/**
* 类型对应的值
*/
@ -24,4 +28,39 @@ public class CarRecordMessageDto {
*/
private Long time;
public byte getType(){
switch (addr){
case 3:
return 0;
case 16:
case 17:
return 1;
case 18:
return 8;
case 19:
return 9;
case 20:
return 10;
case 21:
case 22:
case 23:
return 7;
case 25:
case 26:
return 3;
case 27:
case 28:
return 4;
case 29:
case 30:
return 5;
case 31:
case 32:
return 6;
case 24:
default:
return 2;
}
}
}

11
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java

@ -14,6 +14,8 @@ public class FirstAidRecord implements Serializable {
private Long beginTime;
private Long stepId;
private Date createdAt;
private Date updatedAt;
@ -62,6 +64,14 @@ public class FirstAidRecord implements Serializable {
this.beginTime = beginTime;
}
public Long getStepId() {
return stepId;
}
public void setStepId(Long stepId) {
this.stepId = stepId;
}
public Date getCreatedAt() {
return createdAt;
}
@ -97,6 +107,7 @@ public class FirstAidRecord implements Serializable {
sb.append(", type=").append(type);
sb.append(", value=").append(value);
sb.append(", beginTime=").append(beginTime);
sb.append(", stepId=").append(stepId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);

60
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java

@ -415,6 +415,66 @@ public class FirstAidRecordExample {
return (Criteria) this;
}
public Criteria andStepIdIsNull() {
addCriterion("step_id is null");
return (Criteria) this;
}
public Criteria andStepIdIsNotNull() {
addCriterion("step_id is not null");
return (Criteria) this;
}
public Criteria andStepIdEqualTo(Long value) {
addCriterion("step_id =", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdNotEqualTo(Long value) {
addCriterion("step_id <>", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdGreaterThan(Long value) {
addCriterion("step_id >", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdGreaterThanOrEqualTo(Long value) {
addCriterion("step_id >=", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdLessThan(Long value) {
addCriterion("step_id <", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdLessThanOrEqualTo(Long value) {
addCriterion("step_id <=", value, "stepId");
return (Criteria) this;
}
public Criteria andStepIdIn(List<Long> values) {
addCriterion("step_id in", values, "stepId");
return (Criteria) this;
}
public Criteria andStepIdNotIn(List<Long> values) {
addCriterion("step_id not in", values, "stepId");
return (Criteria) this;
}
public Criteria andStepIdBetween(Long value1, Long value2) {
addCriterion("step_id between", value1, value2, "stepId");
return (Criteria) this;
}
public Criteria andStepIdNotBetween(Long value1, Long value2) {
addCriterion("step_id not between", value1, value2, "stepId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;

11
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java

@ -12,6 +12,8 @@ public class Step implements Serializable {
private Integer sequence;
private Byte stepType;
private Date createdAt;
private Date updatedAt;
@ -52,6 +54,14 @@ public class Step implements Serializable {
this.sequence = sequence;
}
public Byte getStepType() {
return stepType;
}
public void setStepType(Byte stepType) {
this.stepType = stepType;
}
public Date getCreatedAt() {
return createdAt;
}
@ -86,6 +96,7 @@ public class Step implements Serializable {
sb.append(", name=").append(name);
sb.append(", code=").append(code);
sb.append(", sequence=").append(sequence);
sb.append(", stepType=").append(stepType);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);

60
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java

@ -365,6 +365,66 @@ public class StepExample {
return (Criteria) this;
}
public Criteria andStepTypeIsNull() {
addCriterion("step_type is null");
return (Criteria) this;
}
public Criteria andStepTypeIsNotNull() {
addCriterion("step_type is not null");
return (Criteria) this;
}
public Criteria andStepTypeEqualTo(Byte value) {
addCriterion("step_type =", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeNotEqualTo(Byte value) {
addCriterion("step_type <>", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeGreaterThan(Byte value) {
addCriterion("step_type >", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("step_type >=", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeLessThan(Byte value) {
addCriterion("step_type <", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeLessThanOrEqualTo(Byte value) {
addCriterion("step_type <=", value, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeIn(List<Byte> values) {
addCriterion("step_type in", values, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeNotIn(List<Byte> values) {
addCriterion("step_type not in", values, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeBetween(Byte value1, Byte value2) {
addCriterion("step_type between", value1, value2, "stepType");
return (Criteria) this;
}
public Criteria andStepTypeNotBetween(Byte value1, Byte value2) {
addCriterion("step_type not between", value1, value2, "stepType");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;

7
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java

@ -32,6 +32,10 @@ public class CarRecordMessageVo extends BaseMessageDto {
* 流程
*/
private String step;
/**
* 流程
*/
private Byte stepType;
}
private Data data;
@ -40,7 +44,7 @@ public class CarRecordMessageVo extends BaseMessageDto {
setTime(System.currentTimeMillis());
}
public CarRecordMessageVo(String carNumber,int type,String value,Long time,String step){
public CarRecordMessageVo(String carNumber,int type,String value,Long time,String step,Byte stepType){
this();
Data d = new Data();
d.setCarNumber(carNumber);
@ -48,6 +52,7 @@ public class CarRecordMessageVo extends BaseMessageDto {
d.setValue(value);
d.setTime(time);
d.setStep(step);
d.setStepType(stepType);
setData(d);
}
}

2
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RfidVo.java

@ -23,4 +23,6 @@ public class RfidVo {
@ApiModelProperty("医院id")
private byte hospitalId;
}
}

16
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/StepVo.java

@ -0,0 +1,16 @@
package com.ccsens.wisdomcar.bean.vo;
import lombok.Data;
/**
* @author
*/
@Data
public class StepVo {
@Data
public static class Step{
private String stepCode;
private byte stepType;
}
}

5
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/StepDao.java

@ -1,5 +1,6 @@
package com.ccsens.wisdomcar.persist.dao;
import com.ccsens.wisdomcar.bean.vo.StepVo;
import com.ccsens.wisdomcar.persist.mapper.StepMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -15,7 +16,7 @@ public interface StepDao extends StepMapper {
* @param value rfid
* @return 返回流程的code
*/
String getCodeByRfId(@Param("rfid") String value);
StepVo.Step getCodeByRfId(@Param("rfid") String value);
String getCodeByStepOne();
StepVo.Step getCodeByStepOne();
}

64
wisdomcar/src/main/java/com/ccsens/wisdomcar/rabbitMQ/RabbitController.java

@ -2,6 +2,7 @@ package com.ccsens.wisdomcar.rabbitMQ;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.util.bean.message.common.OutMessage;
import com.ccsens.util.bean.message.common.OutMessageSet;
@ -16,7 +17,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Set;
import java.util.*;
@Slf4j
@Component
@ -38,18 +39,77 @@ public class RabbitController {
if (CollectionUtil.isEmpty(messageSet)) {
return;
}
List<CarRecordMessageDto> carRecordMessageDtoList = new ArrayList<>();
Map<Integer ,Long> map = new HashMap<>();
messageSet.forEach(outMessage -> {
CarRecordMessageDto carRecordMessageDto = JSONObject.parseObject(outMessage.getData(),CarRecordMessageDto.class);
if(ObjectUtil.isNull(carRecordMessageDto)){
return;
}
switch (carRecordMessageDto.getType()){
case 2:
getWeight(carRecordMessageDtoList, map, carRecordMessageDto,16);
break;
case 3:
// getWeight(carRecordMessageDtoList, map, carRecordMessageDto,25);
break;
case 4:
// getWeight(carRecordMessageDtoList, map, carRecordMessageDto,27);
break;
case 5:
// getWeight(carRecordMessageDtoList, map, carRecordMessageDto,29);
break;
case 6:
// getWeight(carRecordMessageDtoList, map, carRecordMessageDto,31);
break;
case 7:
map.put(carRecordMessageDto.getAddr(),Long.parseLong(carRecordMessageDto.getValue()));
if(map.get(18) != null && map.get(19) != null && map.get(20) != null ){
String value = map.get(18) + "," + map.get(19) + "," + map.get(20);
carRecordMessageDto.setValue(value);
carRecordMessageDtoList.add(carRecordMessageDto);
}
break;
default:
carRecordMessageDtoList.add(carRecordMessageDto);
break;
}
});
carRecordMessageDtoList.forEach(carRecordMessageDto -> {
try {
recordService.disposeMessage(carRecordMessageDto);
} catch (Exception e) {
log.error("处理平车信息异常",e);
e.printStackTrace();
}
});
}
private void getWeight(List<CarRecordMessageDto> carRecordMessageDtoList, Map<Integer, Long> map, CarRecordMessageDto carRecordMessageDto,int highAddr) {
boolean flag = carRecordMessageDto.getAddr() == highAddr;
Long weight = getWeight(map, carRecordMessageDto, flag ? highAddr + 1 : highAddr,flag);
if(weight == null){
return;
}
carRecordMessageDto.setValue(weight.toString());
carRecordMessageDtoList.add(carRecordMessageDto);
}
private Long getWeight(Map<Integer, Long> map, CarRecordMessageDto carRecordMessageDto,int value2,boolean firstHigh) {
if(map.get(value2) == null){
map.put(carRecordMessageDto.getAddr(),Long.parseLong(carRecordMessageDto.getValue()));
return null;
}else {
long weight1 = Long.parseLong(carRecordMessageDto.getValue());
long weight2 = map.get(value2);
if(firstHigh){
return weight1 << 16 + weight2;
}else {
return weight2 << 16 + weight1;
}
}
}
}

44
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java

@ -12,6 +12,7 @@ import com.ccsens.util.bean.message.common.MessageRule;
import com.ccsens.wisdomcar.bean.dto.Message.CarRecordMessageDto;
import com.ccsens.wisdomcar.bean.po.*;
import com.ccsens.wisdomcar.bean.vo.Message.CarRecordMessageVo;
import com.ccsens.wisdomcar.bean.vo.StepVo;
import com.ccsens.wisdomcar.persist.dao.StepDao;
import com.ccsens.wisdomcar.persist.mapper.*;
import com.ccsens.wisdomcar.util.Constant;
@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
@ -61,7 +63,7 @@ public class RecordService implements IRecordService{
//查找平车信息
WisdomCar wisdomCar = null;
WisdomCarExample wisdomCarExample = new WisdomCarExample();
wisdomCarExample.createCriteria().andCarNumberEqualTo(carRecordMessageDto.getCarNumber());
wisdomCarExample.createCriteria().andCarNumberEqualTo(carRecordMessageDto.getAuthId());
List<WisdomCar> wisdomCars = wisdomCarMapper.selectByExample(wisdomCarExample);
if(CollectionUtil.isNotEmpty(wisdomCars)){
wisdomCar = wisdomCars.get(0);
@ -86,15 +88,21 @@ public class RecordService implements IRecordService{
screenList.forEach(screen -> userIdSet.add(screen.getUserId().toString()));
}
//获取流程
String step = null;
if(carRecordMessageDto.getType() == Constant.CAR_RECORD_WEIGHT){
StepVo.Step step = null;
if(carRecordMessageDto.getType() == Constant.CAR_RECORD_WEIGHT || carRecordMessageDto.getType() == Constant.CAR_RECORD_START){
step = stepDao.getCodeByStepOne();
//处理体重数据
int weightInt = Integer.parseInt(carRecordMessageDto.getValue());
BigDecimal weight = BigDecimal.valueOf(weightInt).divide(BigDecimal.valueOf(1000),3,BigDecimal.ROUND_HALF_UP);
carRecordMessageDto.setValue(weight+"");
}
if(carRecordMessageDto.getType() == Constant.CAR_RECORD_RFID){
step = stepDao.getCodeByRfId(carRecordMessageDto.getValue());
}
//发送消息
sendRecordMessage(carRecordMessageDto,userIdSet,step);
sendRecordMessage(carRecordMessageDto,userIdSet,step == null?null:step.getStepCode(),step == null?null:step.getStepType());
//如果是称重信息,制造测试数据发送大屏
if(carRecordMessageDto.getType() == Constant.CAR_RECORD_WEIGHT){
@ -106,7 +114,7 @@ public class RecordService implements IRecordService{
private void doseAndSensorMessage(CarRecordMessageDto carRecordMessageDto, Set<String> userIdSet) throws Exception {
//体重 单位g
int weightInt = Integer.parseInt(carRecordMessageDto.getValue());
BigDecimal weightInt = BigDecimal.valueOf(Double.parseDouble(carRecordMessageDto.getValue()));
// /*剂量数据*/
// //计算剂量信息 总剂量 = 重量 * 0.9,团注剂量=总剂量*10%,维持剂量=总剂量*90%,均保留两位小数(重量为kg,消息发送的重量为g,需处理)
// String dosage;
@ -129,13 +137,14 @@ public class RecordService implements IRecordService{
/*称重传感器数据*/
//获取一个5000以内的平均数
Random random = new Random();
int randomWeight = random.nextInt(5000);
BigDecimal randomWeight1 = BigDecimal.valueOf(random.nextInt(5000)).divide(BigDecimal.valueOf(1000),3,BigDecimal.ROUND_HALF_UP);
BigDecimal randomWeight2 = BigDecimal.valueOf(random.nextInt(5000)).divide(BigDecimal.valueOf(1000),3,BigDecimal.ROUND_HALF_UP);
//体重除以4
int aveWeight = weightInt / 4;
int sensor1 = aveWeight - randomWeight;
int sensor2 = aveWeight + randomWeight;
int sensor3 = aveWeight - randomWeight;
int sensor4 = weightInt - sensor1 - sensor2 - sensor3;
BigDecimal aveWeight = weightInt.divide(BigDecimal.valueOf(4),3,BigDecimal.ROUND_HALF_UP);
BigDecimal sensor1 = aveWeight.subtract(randomWeight1);
BigDecimal sensor2 = aveWeight.add(randomWeight1);
BigDecimal sensor3 = aveWeight.subtract(randomWeight2);
BigDecimal sensor4 = weightInt.subtract(sensor1).subtract(sensor2).subtract(sensor3);
//第一个传感器
CarRecordMessageDto sensorMessage1 = new CarRecordMessageDto();
@ -143,28 +152,28 @@ public class RecordService implements IRecordService{
sensorMessage1.setType(Constant.WEIGHT_SENSOR_1);
sensorMessage1.setValue(sensor1 + "");
//发送消息
sendRecordMessage(sensorMessage1,userIdSet,null);
sendRecordMessage(sensorMessage1,userIdSet,null,null);
//第二个传感器
CarRecordMessageDto sensorMessage2 = new CarRecordMessageDto();
BeanUtil.copyProperties(carRecordMessageDto,sensorMessage2);
sensorMessage2.setType(Constant.WEIGHT_SENSOR_2);
sensorMessage2.setValue(sensor2 + "");
//发送消息
sendRecordMessage(sensorMessage2,userIdSet,null);
sendRecordMessage(sensorMessage2,userIdSet,null,null);
//第三个传感器
CarRecordMessageDto sensorMessage3 = new CarRecordMessageDto();
BeanUtil.copyProperties(carRecordMessageDto,sensorMessage3);
sensorMessage3.setType(Constant.WEIGHT_SENSOR_3);
sensorMessage3.setValue(sensor3 + "");
//发送消息
sendRecordMessage(sensorMessage3,userIdSet,null);
sendRecordMessage(sensorMessage3,userIdSet,null,null);
//第四个传感器
CarRecordMessageDto sensorMessage4 = new CarRecordMessageDto();
BeanUtil.copyProperties(carRecordMessageDto,sensorMessage4);
sensorMessage4.setType(Constant.WEIGHT_SENSOR_4);
sensorMessage4.setValue(sensor4 + "");
//发送消息
sendRecordMessage(sensorMessage4,userIdSet,null);
sendRecordMessage(sensorMessage4,userIdSet,null,null);
// /*震动传感器数据*/
// //随机生成坐标
@ -186,8 +195,9 @@ public class RecordService implements IRecordService{
/**
* 发送消息
*/
private void sendRecordMessage(CarRecordMessageDto carRecordMessageDto,Set<String> userIdSet,String step) throws Exception {
CarRecordMessageVo carRecordMessageVo = new CarRecordMessageVo(carRecordMessageDto.getCarNumber(),carRecordMessageDto.getType(),carRecordMessageDto.getValue(),carRecordMessageDto.getTime(),step);
private void sendRecordMessage(CarRecordMessageDto carRecordMessageDto,Set<String> userIdSet,String stepCode,Byte stepType) throws Exception {
CarRecordMessageVo carRecordMessageVo = new CarRecordMessageVo(carRecordMessageDto.getAuthId(),carRecordMessageDto.getType(),
carRecordMessageDto.getValue(),carRecordMessageDto.getTime(),stepCode,stepType);
MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User);
String s = JacksonUtil.beanToJson(carRecordMessageVo);

4
wisdomcar/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring:
profiles:
active: test
include: common, util-test
active: dev
include: common, util-dev

10
wisdomcar/src/main/resources/mapper_dao/StepDao.xml

@ -3,9 +3,10 @@
<mapper namespace="com.ccsens.wisdomcar.persist.dao.StepDao">
<select id="getCodeByRfId" resultType="java.lang.String">
<select id="getCodeByRfId" resultType="com.ccsens.wisdomcar.bean.vo.StepVo$Step">
SELECT
s.
s.code as stepCode,
s.step_type as stepType
FROM
`t_step` s,
t_rfid r
@ -14,9 +15,10 @@
and r.rfid = #{rfid}
limit 1
</select>
<select id="getCodeByStepOne" resultType="java.lang.String">
<select id="getCodeByStepOne" resultType="com.ccsens.wisdomcar.bean.vo.StepVo$Step">
SELECT
s.code
s.code as stepCode,
s.step_type as stepType
FROM
`t_step` s
ORDER BY id

27
wisdomcar/src/main/resources/mapper_raw/FirstAidRecordMapper.xml

@ -7,6 +7,7 @@
<result column="type" jdbcType="TINYINT" property="type" />
<result column="value" jdbcType="VARCHAR" property="value" />
<result column="begin_time" jdbcType="BIGINT" property="beginTime" />
<result column="step_id" jdbcType="BIGINT" property="stepId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -70,7 +71,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, first_aid_id, type, value, begin_time, created_at, updated_at, rec_status
id, first_aid_id, type, value, begin_time, step_id, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.wisdomcar.bean.po.FirstAidRecordExample" resultMap="BaseResultMap">
select
@ -104,11 +105,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.wisdomcar.bean.po.FirstAidRecord">
insert into t_first_aid_record (id, first_aid_id, type,
value, begin_time, created_at,
updated_at, rec_status)
value, begin_time, step_id,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{firstAidId,jdbcType=BIGINT}, #{type,jdbcType=TINYINT},
#{value,jdbcType=VARCHAR}, #{beginTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{value,jdbcType=VARCHAR}, #{beginTime,jdbcType=BIGINT}, #{stepId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.wisdomcar.bean.po.FirstAidRecord">
insert into t_first_aid_record
@ -128,6 +131,9 @@
<if test="beginTime != null">
begin_time,
</if>
<if test="stepId != null">
step_id,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -154,6 +160,9 @@
<if test="beginTime != null">
#{beginTime,jdbcType=BIGINT},
</if>
<if test="stepId != null">
#{stepId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -189,6 +198,9 @@
<if test="record.beginTime != null">
begin_time = #{record.beginTime,jdbcType=BIGINT},
</if>
<if test="record.stepId != null">
step_id = #{record.stepId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -210,6 +222,7 @@
type = #{record.type,jdbcType=TINYINT},
value = #{record.value,jdbcType=VARCHAR},
begin_time = #{record.beginTime,jdbcType=BIGINT},
step_id = #{record.stepId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -232,6 +245,9 @@
<if test="beginTime != null">
begin_time = #{beginTime,jdbcType=BIGINT},
</if>
<if test="stepId != null">
step_id = #{stepId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -250,6 +266,7 @@
type = #{type,jdbcType=TINYINT},
value = #{value,jdbcType=VARCHAR},
begin_time = #{beginTime,jdbcType=BIGINT},
step_id = #{stepId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

25
wisdomcar/src/main/resources/mapper_raw/StepMapper.xml

@ -6,6 +6,7 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
<result column="step_type" jdbcType="TINYINT" property="stepType" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -69,7 +70,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, code, sequence, created_at, updated_at, rec_status
id, name, code, sequence, step_type, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.wisdomcar.bean.po.StepExample" resultMap="BaseResultMap">
select
@ -103,11 +104,11 @@
</delete>
<insert id="insert" parameterType="com.ccsens.wisdomcar.bean.po.Step">
insert into t_step (id, name, code,
sequence, created_at, updated_at,
rec_status)
sequence, step_type, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{sequence,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{sequence,jdbcType=INTEGER}, #{stepType,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.wisdomcar.bean.po.Step">
insert into t_step
@ -124,6 +125,9 @@
<if test="sequence != null">
sequence,
</if>
<if test="stepType != null">
step_type,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -147,6 +151,9 @@
<if test="sequence != null">
#{sequence,jdbcType=INTEGER},
</if>
<if test="stepType != null">
#{stepType,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -179,6 +186,9 @@
<if test="record.sequence != null">
sequence = #{record.sequence,jdbcType=INTEGER},
</if>
<if test="record.stepType != null">
step_type = #{record.stepType,jdbcType=TINYINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -199,6 +209,7 @@
name = #{record.name,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
sequence = #{record.sequence,jdbcType=INTEGER},
step_type = #{record.stepType,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -218,6 +229,9 @@
<if test="sequence != null">
sequence = #{sequence,jdbcType=INTEGER},
</if>
<if test="stepType != null">
step_type = #{stepType,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -235,6 +249,7 @@
set name = #{name,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
sequence = #{sequence,jdbcType=INTEGER},
step_type = #{stepType,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

Loading…
Cancel
Save