utils

package
v0.0.0-...-e1989bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2021 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

**************************************************

** @Desc : This file for sql动态查询 构造where
** @Time : 2018.10.19 15:19
** @Author : Joker
** @File : generate_sql
** @Last Modified by : Joker
** @Last Modified time: 2019-5-29 10:37:16
** @Software: GoLand

***************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateSQL

type GenerateSQL struct{}

func (*GenerateSQL) GenWhere

func (*GenerateSQL) GenWhere(wh [][]string) (rs string)

generate where through a where [][]string

func (*GenerateSQL) GenWhereByStruct

func (the *GenerateSQL) GenWhereByStruct(pm interface{}) (string, []interface{})

generate where 1. between的参数必须两个,即start和end必须同时存在或同时没有,违反了此条件,where语句依然正确,但是args不正确 2. between参数必须小的声明在大的上面 3. like参数 "*like" 匹配 "%xxx", "*like*"和"like"匹配"%xxxx%","like*"匹配"xxx%"

func (*GenerateSQL) IfValueIsNil

func (*GenerateSQL) IfValueIsNil(arg interface{}) bool

judge default value

func (*GenerateSQL) RemoveValueOfZero

func (the *GenerateSQL) RemoveValueOfZero(se []interface{}) []interface{}

remove value of nil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL