前端sql条件拼接js工具

02-27 1398阅读

因为项目原因,需要前端写sql,所以弄了一套sql条件拼接的js工具

​
/*常量
LT : " = ",
NE : " != ",
EQ : " = ",
LIKE : " like ",
OR : " or ",
IN : " in ",
*/
let sqlUtil = {
    // 拼接sql
    buildSql : '',
    /*函数*/
    lt: lessThan,
    lte: lessThanOrEqual,
    gt: greaterThan,
    gte: greaterThanOrEqual,
    ne: notEqual,
    eq: equal,
    toLike: sqlLike,
    leftLike:leftLike,
    rightLike:rightLike,
    in: sqlIn,
    notIn: notIn,
    isNull: isNull,
    isNotNull: isNotNull,
    isEmpty: isEmpty,
    isEmptyOrNull: isEmptyOrNull,
    isNotEmpty:isNotEmpty,
    isNotEmptyAndNotNull:isNotEmptyAndNotNull,
    sor: simpleOr,
    toBetween: between,
    notBetween : notBetween,
    sqlOr: sqlOr,
    orderByDesc : orderByDesc,
    orderByAsc: orderByAsc,
    orderBy: orderBy,
    notDelete : notDelete,
    userDefined:userDefined,
    toSql: toSql
};
/**
 * 小于 

前端sql条件拼接js工具

VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]