Tag:condition

  • Mybatis [13] – the use of mybatis dynamic SQL tag

    Time:2021-2-26

    Mybatis has a powerful feature. Other frameworks should be very careful when splicing SQL. For example, where spaces are needed, we should also pay attention to removing the comma of the last column name in the list. The dynamic SQL of mybtis can help us escape such a painful struggle, that is, theDynamic SQLIt can […]

  • JS conditional statement

    Time:2021-2-25

    1. If structure Grammar: If (condition){ Satisfies the statement block to be executed } Implementation process: 1. Judgment conditions2. If the condition is true, the contents in the statement block are executed3. If the condition is false, skip the statement block to execute other contents be careful: (1) the condition in if should be a […]

  • Knowledge sharing: 1 = 1 after where condition in SQL statement is

    Time:2021-2-24

      This code should be generated by the program. The condition after 1 = 1 in the where condition is dynamically changed through the if block. For example:   String sql=”select * from table_name  where 1=1″; if( conditon 1) {   sql=sql+”  and  var2=value2″; } if(conditon 2) {   sql=sql+”  and var3=value3″; } Where 1 […]

  • Best practice of react conditional rendering (7 methods)

    Time:2021-2-19

    In react, conditional rendering can be used in many ways. Different ways of using the scene depend on different contexts. In this article, we’ll discuss all the ways you can use to write better code for conditional rendering in react. ~~ Conditional rendering is a common function in every programming language (including JavaScript). In JavaScript, […]

  • Sum with native JS

    Time:2021-2-12

    (1) Find the sum of all numbers within 100 divisible by 3 and 7 /*Step: use variable to store target number accumulation sum For sets the body of the loop If setting meets the condition*/ var sum = 0 for (var i = 1; i <= 100; i++) { if (i % 3 == 0 […]

  • Database notes

    Time:2021-2-11

    Database:   DDl:Create statementCreate, alter, drop, etc   DML:Update data addition, deletion and modification     insert,delete,update   DCL:Define security levels and create users   DQL:Used to query     select,from,where Data type:Int / / integerDouble / / decimalDate / / dateVarchar() / / textTo create a library:Create database ‘database name’View database:   show databases; Delete Library:   drop database;Switch libraries:Use ‘Library name’; To create […]

  • Docker based log analysis platform (5) monitoring and alarming

    Time:2021-2-6

    Introduction to x-pack Before elasticstack 5.0, there were a variety of solutions for elk monitoring, and the official plug-ins were also changed, not only the names were messy, but also they were installed one by one. Of course, the official also considered everyone’s sufferings, so they launched x-pack, which is specially used for monitoring. It […]

  • The use of exists in Oracle / PLSQL

    Time:2021-2-2

    The following test table has no data, and the dept table has data. Select directly, there will be data set.        The exists of PLSQL is used to judge whether a subquery has a result set returned. As long as the result set of a subquery has data, the exists is judged to be […]

  • Strategy synchronization / channel, mutex, read / write, deadlock / condition variable

    Time:2021-1-31

      1. Goroutine synchronization Why goroutine synchronization The concept of gorotine synchronization and several ways of synchronization 1.1 why goroutine synchronization is needed package main import ( “fmt” “sync” ) var A = 10 var wg = sync.WaitGroup{} func Add(){ defer wg.Done() for i:=0;i<1000000;i++{ A += 1 } } func main() { wg.Add(2) go Add() […]

  • A detailed explanation of the and & operators in JS

    Time:2021-1-26

    This article mainly introduces the |||||||||||||||||||||||||| one JS in the development of logical operators can be regarded as more common operators, there are three main types: logical and &, logical or | and logical not!. When & & and | join statements, the statements on both sides will be converted to boolean type, and then […]

  • Advanced application of bit operation in PHP practical project

    Time:2021-1-25

    Let’s first look at the common requirements in a system There is an advertisement table. We need to control the display of advertisements Manual loading and unloading. Only VIP view is allowed. The possible table structure is as follows: CREATE TABLE `finger_ad` ( `ad_ id` int(11) unsigned NOT NULL AUTO_ Input comment ‘primary key’, `ad_ […]

  • C — cycle

    Time:2021-1-24

    ————Resume content———— In C language, there are three loops: while loop, do – while loop and for loop.     1、 While loop While: first check whether the conditions for starting the loop are met. When the conditions are met, repeat the statements in the loop until the conditions are not met. The basic form […]