Tag:Query method

  • Rich resolution scenarios of where query conditions in eloquent ORM


    Personal feelingsEloquent ORMOfwhereThe scenario of conditional parsing is not so rich, and many conditional assemblies need to introduce additional conditionsorWhere, whereNotIn, whereBetween, whereNotBetweenTo assist in this. This is not very friendly when doing some abstract bottom query methods, and the query conditions passed by the upper layer are uncertain. If you can flexibly parse all […]

  • MySQL large data paging optimization


    Reference article: Paging query method and its optimization for millions of data in MySQL MySQL paging query optimization     The key points are as follows: In the process of optimizing paging statements, you must pay attention to adding sorting fields to the query statements, and you must create your own tables. Some of them […]

  • Using spring + springboot + mybatis technology to realize the operation of adding, deleting, modifying and checking of enterprise employees


    Business description Requirement description Any enterprise will involve the addition, deletion, modification and query of employees. In the current business system design, we need to design and implement the management of employee information. Business framework analysis In staff information management, it is necessary to add, modify, query and delete employee information, as shown in the […]

  • Writing sqlhelper in visual (*)


    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; using System.Data; using System.Data.SqlClient; insert reference private static string strconn = ConfigurationManager.ConnectionStrings[“DigitalProductShopConnectionString”].ConnectionString; Get connection public static DataTable ChaXun(string sql) { using (DataTable dt=new DataTable()) { using (SqlDataAdapter sda=new SqlDataAdapter(sql,strconn)) { sda.Fill(dt); } return dt; } } Query method public static int FeiChaXun(string sql) { int […]

  • Analysis of the reason why PageHelper paging does not work


    When I was working on the project, I found that the total number of front-end queries always displayed incorrect numbers like 0 or 1. My code is similar to this` Page<Object> result = PageHelper.startPage(query.getPage(), query.getLimit()); //Query whether a role List<GroupMember> glist = groupMemberMapper.selectByUserIdAndGroupId(BaseContextHandler.getUserID(), “roleType”); List<Object> list = this.selectByExample(example); `Later, I went to the GitHub home […]

  • Dynamic data sources that can be increased or decreased at runtime


    At present, there is a service in the company’s project that provides dynamic indicator calculation. You can check different SQL or code configurations in different databases and calculate indicators in real time. Originally, the data source needs to be re configured. If you think about it, you can add or delete it without re starting […]

  • Two ways of querying MySQL when the field type is json.


    The table is structured as follows: id        varchar(32)  info     json   Data: id = 1 Info = {“age”: “18”, “disname”: “Xiaoming”} ——————————————– Now I need to get the disanme value in info. The query methods are as follows: 1.  select t.id,JSON_EXTRACT(t.info,’$.disname’) as disname from tableName t where 1=1 Result: Id = 1, […]