common use

common use

11、服务器时钟同步
sudo vim /etc/systemd/timesyncd.conf

NTP=ntp.tencent.com
FallbackNTP=ntp1.tencent.com,ntp2.tencent.com,ntp3.tencent.com
RootDistanceMaxSec=5
PollIntervalMinSec=32
PollIntervalMaxSec=2048

service systemd-timesyncd restart

chown -R ubuntu:ubuntu /home/aa
10、curl调用post请求传params参数
curl -X POST -H 'X-Access-Token:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjA3OTI2NDcsInVzZXJuYW1lIjoibGlyZW4ifQ.7-u5-GfA-K_EbDQcO6LsnJJumE2aCuonOxf-LYnVSNM' -F 'mineNo=370982030705' -F 'equipNo=ruqin@10.68.83.33' -F 'eventTypeCode=A03A06' -F 'modelId=1715203693151416321' -F 'alarmContent=人员进入:报警' -F 'occurTime=2024-07-12 10:32:07' http://localhost:8080/aiAlarm/saveDibholeEnter
9、
UPDATE ai_p 
SET alarm_id = ( SELECT b.id FROM ai_a AS b WHERE event_c = 'A05232A01232' AND b.occur_time = '2023-07-04 01:18:23' ) 
WHERE
	parent_id = ( SELECT a.id FROM ai_pc AS a WHERE a.occur_time = '2023-07-04 01:18:23' )

update ai_r a set a.rid = (select id from ai_rdata b where a.name = b.name)
8、npm install 报错
pm ERR! invalid json response body at http://registry.npm.taobao.org/posthtml reason: Unexpected token < in JSON at position 0
1、先执行这两个命令
npm config set proxy null   回车
npm config set https-proxy null   回车
2、再执行: npm config set registry http://registry.cnpmjs.org/   回车
3、最后执行:npm install -g cnpm --registry=https://registry.npm.taobao.org   回车

一般都能解决。
7、
<resultMap id="aMap" type="org.jeecg.modules.archive.entity.A">
       <id property="id" column="id"/>
       <result property="xxxXxx" column="xxx_xxx"/>
       <result property="createBy" column="create_by"/>
       <result property="createTime" column="create_time"/>
       <association property="archiveFile" javaType="org.jeecg.modules.archive.entity.F">
           <id property="id" column="f_id"/>
           <result property="fileId" column="f_file_id"/>
           <result property="createBy" column="f_create_by"/>
           <result property="createTime" column="f_create_time"/>
       </association>
   </resultMap>
   
<select id="listBypage" parameterType="org.jeecg.modules.archive.entity.A" resultMap="aMap">
       SELECT a.*, b.*
       FROM archive a
       LEFT JOIN file b ON a.id = b.archive_id
       WHERE a.state = '0' AND a.code like concat(#{entity.code},'%')
       <if test="entity.year!= null">
           <choose>
               <when test="entity.month!= null">
                   AND ( ( DATE_FORMAT(a.start_time,'%Y-%c') <![CDATA[ <concat(concat(#{entity.year}, '-'), #{entity.month}) ]]>
                   AND DATE_FORMAT(a.end_time,'%Y-%c') <![CDATA[ > concat(concat(#{entity.year}, '-'), #{entity.month}) ) ]]>
                   or ( DATE_FORMAT(a.start_time,'%Y-%c') = concat(concat(#{entity.year}, '-'), #{entity.month})
                   or DATE_FORMAT(a.end_time,'%Y-%c') = concat(concat(#{entity.year}, '-'), #{entity.month}) ) )
               </when>
               <otherwise>
                   AND (a.start_time REGEXP #{entity.year} or a.end_time REGEXP #{entity.year})
               </otherwise>
           </choose>
       </if>
   </select>
6、mybatais 一对多
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.archive.mapper.Mapper">

    

    <resultMap id="BaseResultMap" type="org.jeecg.modules.archive.entity.A">
        <id property="id" column="id"/>
        <result property="xxXx" column="xx_xx"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <collection property="archiveFileList" ofType="org.jeecg.modules.archive.entity.F"
                    select="selectArchiveFileList" column="{pId = id}"/>
    </resultMap>

    <select id="listByPage" parameterType="org.jeecg.modules.archive.entity.A" resultMap="BaseResultMap">
        SELECT a.* FROM a a
        WHERE a.state = '0'
    </select>

    <select id="selectArchiveFileList" resultType="org.jeecg.modules.archive.entity.F">
        SELECT b.* FROM f b
        <where>
            b.archive_id = #{archiveId}
        </where>
    </select>
</mapper>
public interface AMapper extends BaseMapper<A> {

    List<A> listByPage(Page<A> page, @Param("entity") A a);

    List<Object> selectArchiveFileList();
}
5、spring-boot服务启动脚本
APP=jeecg-boot-module-system-3.0.jar
# 关闭应用
kill -9 $(ps -ef | grep $APP | grep -v grep | awk '{ print $2 }')
# 启动应用
nohup java -jar -Djasypt.encryptor.password=password@2022 jeecg-boot-module-system-3.0.jar > nohup.out 2>&1 &
4、导出数据库部分数据命令
mysqldump -uroot -ppassword -hlocalhost -P3306 --databases school --tables students --where="id='xxxxxid' "  >/aaaa1.sql
3、RestTemplate GET请求 url拼接复杂参数,携带header
private final static RestTemplate RT;

static {
     SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
     requestFactory.setConnectTimeout(3000);
     requestFactory.setReadTimeout(3000);
     RT = new RestTemplate(requestFactory);
     // 解决乱码问题
     RT.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
 }


public void getCameraList() throws EncoderException, UnsupportedEncodingException {
    String accessToken = getAccessToken();
    String url = "http://0.0.0.0:0000/xxx/xxx/?condition={json}";
    String json = 	"{ \"xxx\": 2, \"xxx\": [{ \"xxx\": 256, \"xxx\": 0, \"xxx\": \"1\" }, { \"xxx\": 100, \"xxx\": 0, \"xxx\": \"0\" } ], \"xxx\": 1, \"xxx\": 0, \"xxx\": 200 }";
    Map<String,String> map = new HashMap();
    map.put("json",json);

    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.parseMediaType(MediaType.APPLICATION_JSON_VALUE));
    headers.set("Authorization", accessToken);

    HttpEntity<String> httpEntity = new HttpEntity<>(null, headers);
    ResponseEntity<String> responseEntity = RT.exchange(url, HttpMethod.GET, httpEntity, String.class,map);

//        System.out.println("返回结果:" +  responseEntity.getBody()+"远程调用get5"+responseEntity.getStatusCode()) ;

    if (responseEntity != null && responseEntity.getBody() != null) {
        System.out.println("返回结果:" + responseEntity.getBody());
    } else {
        System.out.println("查询失败");
    }
}
2、mvn install
mvn install:install-file -Dfile=core-1.0-SNAPSHOT.jar  -Dpackaging=jar
1、看上述关键性提示,说org.apache.commons.commons-collections4这个jar包找不到了,我赶紧查看了一下commons-collections4的依赖树:
mvn dependency:tree -Dverbose -Dincludes=org.apache.commons:commons-collections4 > tree.txt
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值