中-StandardFeatureCurveMapper.xml;6行
| | |
| | | import java.util.List; |
| | | |
| | | public interface StandardFeatureCurveMapper { |
| | | void insertBatch(String titleNameUnion, List<StandardFeatureCurve> curveList2); |
| | | //void insertBatch(String titleNameUnion, List<StandardFeatureCurve> curveList2); |
| | | |
| | | void createTable(@Param("titleNameUnion") String titleNameUnion); |
| | | |
| | |
| | | }else{ //存在表,先清空数据 |
| | | commonMapper.truncate("web_site", "tb_standard_feature_curve_"+titleNameUnion); |
| | | } |
| | | mapper.insertBatch(titleNameUnion,curveList2); |
| | | //mapper.insertBatch(titleNameUnion,curveList2); |
| | | subService.insertBatch(titleNameUnion,curveList2); |
| | | }); |
| | | |
| | | } |
| | |
| | | Date date= ThreadLocalUtil.parse(time1,2); |
| | | System.out.println(date);*/ |
| | | /*1 |
| | | * */ |
| | | List list=subService.searchMaxNum2(date1,date2,"110000001_2023_04"); |
| | | * |
| | | List list=subService.searchMaxNum2(date1,date2,"110000001_2023_04");*/ |
| | | List<StandardFeatureCurve> list=new ArrayList(); |
| | | StandardFeatureCurve sf1=new StandardFeatureCurve(); |
| | | sf1.setTime("00:00:07"); |
| | | sf1.setValue(13.078000259399414); |
| | | list.add(sf1); |
| | | StandardFeatureCurve sf2=new StandardFeatureCurve(); |
| | | sf2.setTime("00:00:07"); |
| | | sf2.setValue(13.078000259399414); |
| | | list.add(sf2); |
| | | subService.insertBatch("122v150ah_0.15c",list); |
| | | return new Response().setII(1,true,list,null); |
| | | } |
| | | } |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | //4-StandardFeatureCurveMapper.xml;6行 |
| | | public void insertBatch(String titleNameUnion, List<StandardFeatureCurve> curveList2){ |
| | | String sql="insert into `web_site`.`tb_standard_feature_curve_"+titleNameUnion+"` (`time`,`value`) values "; |
| | | if(curveList2!=null&&curveList2.size()>0){ |
| | | for (int i=0;i<curveList2.size();i++) { |
| | | StandardFeatureCurve bh=curveList2.get(i); |
| | | sql+="('"+bh.getTime()+"',"+bh.getValue()+")"; |
| | | if(i!=(curveList2.size()-1)){ |
| | | sql+=","; |
| | | } |
| | | } |
| | | } |
| | | sqlExecuteService.execute(sql); |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.whyc.mapper.StandardFeatureCurveMapper" > |
| | | |
| | | |
| | | <insert id="insertBatch"> |
| | | <!-- <insert id="insertBatch"> |
| | | insert into `web_site`.`tb_standard_feature_curve_${titleNameUnion}` (`time`,`value`) values |
| | | <foreach collection="curveList2" item="item" separator=","> |
| | | (#{item.time},#{item.value}) |
| | | </foreach> |
| | | </insert> |
| | | </insert>--> |
| | | <insert id="createTable"> |
| | | CREATE TABLE `web_site`.`tb_standard_feature_curve_${titleNameUnion}` ( |
| | | `id` INT NOT NULL AUTO_INCREMENT, |