소스 검색

修改代码,新增字段

zhonghui 3 년 전
부모
커밋
3f401599ba

+ 161 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/CollectUtils.java

@@ -0,0 +1,161 @@
+package com.boman.common.core.utils;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * 集合工具类
+ *
+ * @author z.h
+ */
+public final class CollectUtils {
+
+    public static <E> List<E> newArrayList() {
+        return new ArrayList<E>();
+    }
+
+    public static <E> List<E> newArrayList(int initialCapacity) {
+        return new ArrayList<E>(initialCapacity);
+    }
+
+    public static <E> List<E> newArrayList(Collection<? extends E> c) {
+        return new ArrayList<E>(c);
+    }
+
+    public static <E> List<E> newArrayList(E... values) {
+        List<E> list = new ArrayList<E>(values.length);
+        for (E e : values) {
+            list.add(e);
+        }
+        return list;
+    }
+
+    /**
+     * 将一个集合按照固定大小查分成若干个集合。
+     *
+     * @param list
+     * @param count
+     * @return
+     */
+    public static <T> List<List<T>> split(final List<T> list, final int count) {
+        List<List<T>> subIdLists = CollectUtils.newArrayList();
+        if (list.size() < count) {
+            subIdLists.add(list);
+        } else {
+            int i = 0;
+            while (i < list.size()) {
+                int end = i + count;
+                if (end > list.size()) {
+                    end = list.size();
+                }
+                subIdLists.add(list.subList(i, end));
+                i += count;
+            }
+        }
+        return subIdLists;
+    }
+
+    public static boolean isEmpty(Collection<?> coll) {
+        return (coll == null || coll.isEmpty());
+    }
+
+    public static boolean isNotEmpty(Collection<?> coll) {
+        return null != coll && !coll.isEmpty();
+    }
+
+    public static <K, V> Map<K, V> newHashMap() {
+        return new HashMap<K, V>();
+    }
+
+    public static <K, V> Map<K, V> newConcurrentHashMap() {
+        return new ConcurrentHashMap<K, V>();
+    }
+
+    public static <E> Queue<E> newConcurrentLinkedQueue() {
+        return new ConcurrentLinkedQueue<E>();
+    }
+
+    public static <K, V> Map<K, V> newHashMap(Map<? extends K, ? extends V> m) {
+        return new HashMap<K, V>(m);
+    }
+
+    public static <K, V> Map<K, V> newLinkedHashMap(Map<? extends K, ? extends V> m) {
+        return new LinkedHashMap<K, V>(m);
+    }
+
+    public static <K, V> Map<K, V> newLinkedHashMap(int size) {
+        return new LinkedHashMap<K, V>(size);
+    }
+
+    public static <E> Set<E> newHashSet() {
+        return new HashSet<E>();
+    }
+
+    public static <E> Set<E> newHashSet(E... values) {
+        Set<E> set = new HashSet<E>(values.length);
+        for (E e : values) {
+            set.add(e);
+        }
+        return set;
+    }
+
+    public static <E> Set<E> newHashSet(Collection<? extends E> c) {
+        return new HashSet<E>(c);
+    }
+
+    public static Map<String, String> toMap(String[]... wordMappings) {
+        Map<String, String> mappings = new HashMap<String, String>();
+        for (int i = 0; i < wordMappings.length; i++) {
+            String singular = wordMappings[i][0];
+            String plural = wordMappings[i][1];
+            mappings.put(singular, plural);
+        }
+        return mappings;
+    }
+    public static <T> List<T> intersection(List<T> first, List<T> second) {
+        List<T> list = CollectUtils.newArrayList();
+        Map<T, Integer> mapa = getCardinalityMap(first), mapb = getCardinalityMap(second);
+        Set<T> elts = new HashSet<T>(first);
+        elts.addAll(second);
+        for (T obj : elts)
+            for (int i = 0, m = Math.min(getFreq(obj, mapa), getFreq(obj, mapb)); i < m; i++)
+                list.add(obj);
+        return list;
+    }
+
+    public static <T> List<T> union(List<T> first, List<T> second) {
+        Map<T, Integer> mapa = getCardinalityMap(first), mapb = getCardinalityMap(second);
+        Set<T> elts = new HashSet<T>(first);
+        elts.addAll(second);
+        List<T> list = newArrayList();
+        for (T obj : elts)
+            for (int i = 0, m = Math.max(getFreq(obj, mapa), getFreq(obj, mapb)); i < m; i++)
+                list.add(obj);
+        return list;
+
+    }
+
+    public static <T> List<T> subtract(List<T> first, List<T> second) {
+        List<T> list = newArrayList(first);
+        for (T t : second)
+            list.remove(t);
+        return list;
+    }
+
+    public static <T> Map<T, Integer> getCardinalityMap(final List<T> coll) {
+        Map<T, Integer> count = newHashMap();
+        for (Iterator<T> it = coll.iterator(); it.hasNext();) {
+            T obj = it.next();
+            Integer c = (count.get(obj));
+            if (c == null) count.put(obj, Integer.valueOf(1));
+            else count.put(obj, new Integer(c.intValue() + 1));
+        }
+        return count;
+    }
+
+    private static final <T> int getFreq(final T obj, final Map<T, Integer> freqMap) {
+        Integer count = freqMap.get(obj);
+        return (count != null) ? count.intValue() : 0;
+    }
+}

+ 9 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/VaccineInfoController.java

@@ -131,4 +131,13 @@ public class VaccineInfoController extends BaseController {
         return AjaxResult.success(vaccineInfoUsers);
     }
 
+
+    /**
+     * 根据身份证号查询用户疫苗信息集合
+     */
+    @PostMapping("/syncData")
+    public AjaxResult syncData() throws Exception {
+        vaccineInfoUserService.syncData();
+        return AjaxResult.success();
+    }
 }

+ 10 - 0
boman-web-core/src/main/java/com/boman/web/core/domain/VaccineInfoOperation.java

@@ -230,6 +230,8 @@ public class VaccineInfoOperation extends BaseEntity {
      */
     private String url;
 
+    private String shouldSlow;
+
     /**
      * 用户接种疫苗信息集合
      */
@@ -497,6 +499,14 @@ public class VaccineInfoOperation extends BaseEntity {
         return progress;
     }
 
+    public String getShouldSlow() {
+        return shouldSlow;
+    }
+
+    public void setShouldSlow(String shouldSlow) {
+        this.shouldSlow = shouldSlow;
+    }
+
     public void setStatus(String status) {
         this.status = status;
     }

+ 60 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/SyncMapper.java

@@ -0,0 +1,60 @@
+package com.boman.web.core.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import com.boman.common.core.utils.obj.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.InsertProvider;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+
+import static com.google.common.base.Strings.isNullOrEmpty;
+
+public interface SyncMapper {
+    Logger LOGGER = LoggerFactory.getLogger(SyncMapper.class);
+
+    @SelectProvider(type = SyncMapper.SqlProvider.class, method = "selectBySql")
+    List<JSONObject> selectBySql(@Param("sql") String sql);
+
+    @SelectProvider(type = SyncMapper.SqlProvider.class, method = "selectCount")
+    int selectCount(@Param("sql") String sql);
+
+
+    @InsertProvider(type = SyncMapper.SqlProvider.class, method = "updateData")
+    int updateData(@Param("jsonObject") JSONObject jsonObject, @Param("key") String key);
+
+    class SqlProvider {
+
+        public String selectBySql(Map<String, Object> para) {
+            return (String) para.get("sql");
+        }
+
+        public String selectCount(Map<String, Object> para) {
+            return (String) para.get("sql");
+        }
+
+
+        public String updateData(Map<String, Object> para) {
+            JSONObject jsonObject = (JSONObject) para.get("jsonObject");
+            String key = (String) para.get("key");
+            String tableName = "vaccine_info";
+            StringBuilder stringBuilder = new StringBuilder();
+            stringBuilder.append("update ").append(tableName).append(" set ");
+            for(String column : jsonObject.keySet()) {
+                if(StringUtils.isNotEmpty((String) jsonObject.get(column))) {
+                    stringBuilder.append(column).append(" = ").append("'").append(jsonObject.get(column)).append("'").append(",");
+                }
+            }
+            String sql = stringBuilder.toString();
+            sql = sql.substring(0, sql.lastIndexOf(","));
+            stringBuilder.append(" where id_card = ").append("''" + key + "");
+            sql += " where id_card = '" + key + "'";
+
+            return sql;
+        }
+    }
+}

+ 3 - 0
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoUserService.java

@@ -23,4 +23,7 @@ public interface IVaccineInfoUserService {
      * @return
      */
     public List<VaccineInfoUser> selectInfoUserByIdCard(VaccineInfoUser vaccineInfoUser);
+
+
+    public void syncData() throws Exception;
 }

+ 278 - 4
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoUserServiceImpl.java

@@ -1,14 +1,21 @@
 package com.boman.web.core.service.vaccineInfo.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.StringUtils;
 import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.web.core.mapper.SyncMapper;
 import com.boman.web.core.mapper.VaccineInfoUserMapper;
+import com.boman.web.core.service.TableServiceCmdService;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoUserService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
 
 /**
  * @author tjf
@@ -16,8 +23,13 @@ import java.util.List;
  */
 @Service
 public class VaccineInfoUserServiceImpl implements IVaccineInfoUserService {
+    Logger LOGGER = LoggerFactory.getLogger(SyncMapper.class);
     @Resource
     private VaccineInfoUserMapper vaccineInfoUserMapper;
+    @Resource
+    private SyncMapper syncMapper;
+    @Resource
+    private TableServiceCmdService cmdService;
 
     /**
      * 批量删除用户接种疫苗信息
@@ -32,16 +44,278 @@ public class VaccineInfoUserServiceImpl implements IVaccineInfoUserService {
 
     /**
      * 根据身份证号查询用户疫苗信息集合
+     *
      * @param vaccineInfoUser
      * @return
      */
     @Override
     public List<VaccineInfoUser> selectInfoUserByIdCard(VaccineInfoUser vaccineInfoUser) {
         String idCard = vaccineInfoUser.getIdCard();
-        List<VaccineInfoUser> list  = new ArrayList();
-        if (StringUtils.isNotBlank(idCard)){
+        List<VaccineInfoUser> list = new ArrayList();
+        if (StringUtils.isNotBlank(idCard)) {
             list = vaccineInfoUserMapper.selectVaccineInfoUserByIdCard(idCard.trim());
         }
         return list;
     }
+
+    /**
+     * 省,市,区
+     * 户籍地详细地址
+     * 现居住地地址
+     * 年龄
+     * 是否完成
+     * 剂次
+     * 疫苗名称
+     * 接种情况(是/否)
+     * 人群分类
+     */
+    @Override
+    public void syncData() throws Exception {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 获取疫苗信息,每次处理1000条
+        int counts = syncMapper.selectCount("select count(1) from vaccine_info");
+        int count = 1;
+//        int counts = 1;
+        int times = counts / 1000;
+        int startPagte = 0;
+        int endPage = 1000;
+
+        for (int i = 0; i < times + 1; i++) {
+            List<JSONObject> vaccInfos = this.getVaccInfo(startPagte, endPage);
+            // 身份证号码
+            List<String> idCards = new ArrayList<>();
+            Map<String, JSONObject> vannInfoMap = new HashMap<>();
+            for (JSONObject vanninfo : vaccInfos) {
+                String idcard = vanninfo.getString("id_card");
+                JSONObject jsonObject = new JSONObject();
+                jsonObject.put("id_card", idcard);
+                // 省
+                jsonObject.put("province", "安徽省");
+                // 市
+                jsonObject.put("city", "安庆市");
+                // 区
+                jsonObject.put("region", "潜山市");
+                vannInfoMap.put(idcard, jsonObject);
+                idCards.add(idcard);
+            }
+
+            List<JSONObject> updateLists = new ArrayList<>();
+            // 获取居住详细地址
+            List<JSONObject> hujiInfos = this.getHujiInfo(idCards);
+            for (JSONObject huji : hujiInfos) {
+                String idcard = huji.getString("zjhm");
+                JSONObject update = vannInfoMap.get(idcard);
+
+                // 户籍地地址
+                String hjdz = huji.getString("hjdxz");
+                if (StringUtils.isNotEmpty(hjdz)) {
+                    update.put("domicile", hjdz);
+                }
+
+                // 现居地详细地址
+                String xxdz = huji.getString("akmdz");
+                if (StringUtils.isNotEmpty(xxdz)) {
+                    update.put("now_in", xxdz);
+                }
+            }
+            int secCount = 1;
+            // 查询疫苗是否完成
+            for (String icsard : idCards) {
+                JSONObject update = vannInfoMap.get(icsard);
+                JSONObject userInfo = this.getvaccUser(icsard);
+                if (userInfo != null) {
+                    // 接种情况
+                    update.put("is_vaccination", "是");
+                    // 疫苗名称
+                    update.put("vaccine_name", userInfo.getString("prod"));
+                    // 剂次
+                    update.put("jici", userInfo.getString("jici"));
+                    // 最后一次接种时间
+                    update.put("vaccination_time", userInfo.getString("v_date"));
+                    // 最后一次接种地点
+                    update.put("vaccination_place", userInfo.getString("vaccination_place"));
+                    // 是否完成
+                    String progress = this.getIsSuccess(userInfo);
+                    update.put("progress", progress);
+                    if (progress.equals("否")) {
+                        // 下次应接时间
+                        String nextTime = this.getTime(userInfo, sdf);
+                        update.put("vaccine_time_next", nextTime);
+                    }
+                    // 生产厂家
+                    update.put("manufacturer", userInfo.getString("manufacturer"));
+                    // 联系方式
+                    update.put("phone_num", userInfo.getString("phone_num"));
+                    // 工作单位
+                    update.put("work_unit", userInfo.getString("work_unit"));
+                    // 年龄
+                    String ageStr = userInfo.getString("csrq");
+                    int age = getAge(ageStr, icsard);
+                    update.put("age", age + "");
+
+                    update.put("should_be", "否");
+                } else {
+                    update.put("progress", "否");
+                    update.put("is_vaccination", "否");
+                    update.put("should_be", "是");
+                }
+
+                System.out.println("secCount: " + secCount);
+                secCount++;
+            }
+            this.updateData(new ArrayList(vannInfoMap.values()), count);
+            count++;
+            startPagte += 1000;
+        }
+    }
+
+    private List<JSONObject> getVaccInfo(int startPagte, int endPage) {
+        String sql = "select * from vaccine_info limit " + startPagte + ", " + endPage;
+        List<JSONObject> objs = syncMapper.selectBySql(sql);
+        return objs;
+    }
+
+    private List<JSONObject> getHujiInfo(List<String> idCards) {
+        if (idCards == null || idCards.size() <= 0) {
+            return new ArrayList<>();
+        }
+        String sql = "select * from hj_hj where zjhm in (";
+        String cond = "";
+        for (String idCard : idCards) {
+            cond += "'" + idCard + "'" + ",";
+        }
+        sql += cond.substring(0, cond.length() - 1) + ")";
+        List<JSONObject> objs = syncMapper.selectBySql(sql);
+        return objs;
+    }
+
+    private JSONObject getvaccUser(String idcard) {
+        String sql = "SELECT id,`接种日期` as v_date,`生产厂家` as prod,`接种针次` as jici, "
+                + " `人群分类` as crowd_classification, `接种单位` as vaccination_place," +
+                " `电话号码` as phone_num , `出生日期` as 'csrq', `工作单位` as work_unit,  `生产厂家` as manufacturer"
+                + " FROM ymjz WHERE `身份证` = '" + idcard + "' ORDER BY `接种日期` desc limit 1";
+        List<JSONObject> objs = syncMapper.selectBySql(sql);
+        if (objs != null && objs.size() > 0) {
+            return objs.get(0);
+        }
+        return null;
+    }
+
+    private String getTime(JSONObject userInfo, SimpleDateFormat sdf) throws Exception {
+        String prod = userInfo.getString("prod");
+        String time = userInfo.getString("v_date");
+        Date preDate = sdf.parse(time);
+        if (prod.equals("北京科兴中维")) {
+            return newDate(preDate, 14, sdf);
+        } else if (prod.equals("北京生物")) {
+            return newDate(preDate, 21, sdf);
+        } else if (prod.equals("兰州生物")) {
+            return newDate(preDate, 21, sdf);
+        } else if (prod.equals("深圳康泰")) {
+            return newDate(preDate, 28, sdf);
+        } else if (prod.equals("安徽智飞")) {
+            return newDate(preDate, 28, sdf);
+        }
+        return "";
+    }
+
+    private String newDate(Date date, int day, SimpleDateFormat sdf) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, day);
+        String newTime = sdf.format(calendar.getTime());
+        return newTime;
+    }
+
+    private String getIsSuccess(JSONObject userInfo) {
+        String prod = userInfo.getString("prod");
+        String jici = userInfo.getString("jici");
+        if (prod.equals("北京科兴中维")) {
+            if (jici.equals("2")) {
+                return "是";
+            } else {
+                return "否";
+            }
+        } else if (prod.equals("北京生物")) {
+            if (jici.equals("2")) {
+                return "是";
+            } else {
+                return "否";
+            }
+        } else if (prod.equals("兰州生物")) {
+            if (jici.equals("2")) {
+                return "是";
+            } else {
+                return "否";
+            }
+        } else if (prod.equals("深圳康泰")) {
+            if (jici.equals("2")) {
+                return "是";
+            } else {
+                return "否";
+            }
+        } else if (prod.equals("安徽智飞")) {
+            if (jici.equals("3")) {
+                return "是";
+            } else {
+                return "否";
+            }
+        }
+
+        return "否";
+    }
+
+    /**
+     * 获取年龄
+     *
+     * @param birthDayStr
+     * @return
+     * @throws Exception
+     */
+    public int getAge(String birthDayStr, String idcard) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date birthDay = null;
+        try {
+            birthDay = sdf.parse(birthDayStr);
+        } catch (Exception e) {
+            System.out.println("idCard:" + idcard);
+            return 0;
+        }
+
+
+        Calendar cal = Calendar.getInstance();
+        if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
+            throw new IllegalArgumentException(
+                    "The birthDay is before Now.It's unbelievable!");
+        }
+        int yearNow = cal.get(Calendar.YEAR);  //当前年份
+        int monthNow = cal.get(Calendar.MONTH);  //当前月份
+        int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
+        cal.setTime(birthDay);
+        int yearBirth = cal.get(Calendar.YEAR);
+        int monthBirth = cal.get(Calendar.MONTH);
+        int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
+        int age = yearNow - yearBirth;   //计算整岁数
+        if (monthNow <= monthBirth) {
+            if (monthNow == monthBirth) {
+                if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
+            } else {
+                age--;//当前月份在生日之前,年龄减一
+            }
+        }
+        return age;
+    }
+
+    public int updateData(List<JSONObject> dataList, int count) {
+
+        for (JSONObject jsonObject : dataList) {
+            try {
+                LOGGER.info("已处理 count: {} \r\n", count);
+                syncMapper.updateData(jsonObject, (String) jsonObject.getString("id_card"));
+            } catch (Exception e) {
+                LOGGER.info("错误数据: {} \r\n 新增的数据为: {}", jsonObject);
+            }
+        }
+        return dataList.size();
+    }
 }

+ 11 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/ColumnUtils.java

@@ -9,6 +9,9 @@ import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.array.ArrayUtils;
 import com.boman.common.core.utils.collection.CollectionUtils;
 import com.boman.common.core.utils.obj.ObjectUtils;
+import com.boman.common.redis.RedisKey;
+import com.boman.common.redis.service.RedisService;
+import com.boman.domain.GenTable;
 import com.boman.domain.GenTableColumn;
 import com.boman.domain.constant.MysqlDataTypeConst;
 import com.boman.domain.exception.UnknownColumnException;
@@ -110,6 +113,14 @@ public class ColumnUtils {
         return returnData;
     }
 
+    public static List<GenTableColumn> getColumnList(String tableName){
+        requireNonNull(tableName, "getPkName tableName is empty");
+        RedisService redisService = SpringUtils.getBean(RedisService.class);
+        GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + tableName.trim());
+        requireNonNull(genTable, String.format("表名为: %s 的表不存在缓存中", tableName));
+        return genTable.getColumns();
+    }
+
     /**
      * 功能描述: 判断mask  == 0 返回true
      *

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/IdUtils.java

@@ -57,6 +57,11 @@ public class IdUtils {
         throw new IllegalArgumentException("获取主键失败");
     }
 
+
+    public static String getPkName(String tableName) {
+        return getPkName(ColumnUtils.getColumnList(tableName));
+    }
+
     public static void putIfNotContains(JSONArray jsonArray, String input) {
         if (isEmpty(jsonArray)) {
             jsonArray = new JSONArray();

+ 5 - 1
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="manufacturer"    column="manufacturer"    />
         <result property="nowIn"    column="now_in"    />
         <result property="url"    column="url"    />
+        <result property="shouldSlow"    column="should_slow"    />
         <collection  property="vaccineInfoUserList"   javaType="java.util.List"        resultMap="VaccineInfoUser" />
     </resultMap>
 
@@ -67,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectVaccineInfoList" parameterType="VaccineInfoOperation" resultMap="VaccineInfoResult">
-        select vi.id, vi.village_towns, vi.village, vi.villager_group, vi.house_type, vi.domicile, vi.province, vi.city,
+        select vi.id, vi.village_towns, vi.village, vi.villager_group, vi.house_type, vi.domicile, vi.province, vi.city,vi.should_slow,
         vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
         vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend, vi.death, vi.lost_in_missing,
         vi.should_be, vi.other, vi.progress, vi.remark, vi.status, vi.create_by, vi.create_time, vi.update_by, vi.update_time,
@@ -173,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
             <if test="nowIn != null and nowIn != ''">now_in,</if>
             <if test="url != null and url != ''">url,</if>
+            <if test="shouldSlow != null and shouldSlow != ''">should_slow,</if>
             create_time
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -214,6 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
             <if test="nowIn != null and nowIn != ''">#{nowIn},</if>
             <if test="url != null and url != ''">#{url},</if>
+            <if test="shouldSlow != null and shouldSlow != ''">#{shouldSlow},</if>
             sysdate()
          </trim>
     </insert>
@@ -260,6 +263,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
             <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
             <if test="url != null and url != ''">url = #{url},</if>
+            <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
         </trim>
         where id = #{id}
     </update>