黎星凯
2024-04-30 3be9cfcb6b59366b936821966d20a998a6895f9f
consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java
@@ -1,5 +1,11 @@
package com.consum.model.po;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
import org.springframework.jdbc.core.RowMapper;
import com.walker.jdbc.BaseMapper;
import com.walker.jdbc.ResultSetUtils;
import com.walker.jdbc.SqlAndParameters;
@@ -7,16 +13,10 @@
import com.walker.jdbc.sqlgen.InsertBuilder;
import com.walker.jdbc.sqlgen.SelectBuilder;
import com.walker.jdbc.sqlgen.UpdateBuilder;
import com.walker.jdbc.util.StringUtils;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
/**
 * 表名:BASE_CATEGORY *
 *
 * @author genrator
 */
public class BaseCategory_mapper extends BaseCategory implements BaseMapper<BaseCategory> {
@@ -34,6 +34,12 @@
    public static final String States = "states";
    public static final String Levels = "levels";
    public static final String FatherCategoryId = "father_category_id";
    public static final String CreateUserId = "create_user_id";
    public static final String CreateTime = "create_time";
    public static final String CreateUserName = "create_user_name";
    public static final String DTime = "d_time";
    public static final String DUserId = "d_user_id";
    public static final String DUserName = "d_user_name";
    /**
     * 默认构造函数
@@ -42,11 +48,11 @@
        if (baseCategory == null) {
            throw new IllegalArgumentException("po参数不允许为空!");
        }
        //主键
        // 主键
        if (baseCategory.isset_id) {
            this.setId(baseCategory.getId());
        }
        //普通属性
        // 普通属性
        if (baseCategory.isset_categoryName) {
            this.setCategoryName(baseCategory.getCategoryName());
        }
@@ -65,6 +71,24 @@
        if (baseCategory.isset_fatherCategoryId) {
            this.setFatherCategoryId(baseCategory.getFatherCategoryId());
        }
        if (baseCategory.isset_createUserId) {
            this.setCreateUserId(baseCategory.getCreateUserId());
        }
        if (baseCategory.isset_createTime) {
            this.setCreateTime(baseCategory.getCreateTime());
        }
        if (baseCategory.isset_createUserName) {
            this.setCreateUserName(baseCategory.getCreateUserName());
        }
        if (baseCategory.isset_dTime) {
            this.setDTime(baseCategory.getDTime());
        }
        if (baseCategory.isset_dUserId) {
            this.setDUserId(baseCategory.getDUserId());
        }
        if (baseCategory.isset_dUserName) {
            this.setDUserName(baseCategory.getDUserName());
        }
        // 去掉,2022-09-07
        // this.setDatabaseName_(base_category.getDatabaseName_());
    }
@@ -76,12 +100,9 @@
    public String getTableName_() {
        String tableName = "base_category";
        /**
        if (StringUtils.isNotEmpty(this.getDatabaseName_())) {
            return this.getDatabaseName_() + "." + tableName;
        } else {
            return tableName;
        }
        */
         * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; }
         * else { return tableName; }
         */
        return tableName;
    }
@@ -114,6 +135,12 @@
        ib.set(States, this.getStates(), this.isset_states);
        ib.set(Levels, this.getLevels(), this.isset_levels);
        ib.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId);
        ib.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId);
        ib.set(CreateTime, this.getCreateTime(), this.isset_createTime);
        ib.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName);
        ib.set(DTime, this.getDTime(), this.isset_dTime);
        ib.set(DUserId, this.getDUserId(), this.isset_dUserId);
        ib.set(DUserName, this.getDUserName(), this.isset_dUserName);
        return ib.genMapSql();
    }
@@ -129,6 +156,12 @@
        ub.set(States, this.getStates(), this.isset_states);
        ub.set(Levels, this.getLevels(), this.isset_levels);
        ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId);
        ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId);
        ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
        ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName);
        ub.set(DTime, this.getDTime(), this.isset_dTime);
        ub.set(DUserId, this.getDUserId(), this.isset_dUserId);
        ub.set(DUserName, this.getDUserName(), this.isset_dUserName);
        ub.where(this.getPkName_(), this.getPkValue_());
        return ub.genMapSql();
    }
@@ -145,6 +178,12 @@
        ub.set(States, this.getStates(), this.isset_states);
        ub.set(Levels, this.getLevels(), this.isset_levels);
        ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId);
        ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId);
        ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
        ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName);
        ub.set(DTime, this.getDTime(), this.isset_dTime);
        ub.set(DUserId, this.getDUserId(), this.isset_dUserId);
        ub.set(DUserName, this.getDUserName(), this.isset_dUserName);
        return ub.genMapSql(where, parameters);
    }
@@ -160,6 +199,12 @@
        ub.set(States, this.getStates(), this.isset_states);
        ub.set(Levels, this.getLevels(), this.isset_levels);
        ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId);
        ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId);
        ub.set(CreateTime, this.getCreateTime(), this.isset_createTime);
        ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName);
        ub.set(DTime, this.getDTime(), this.isset_dTime);
        ub.set(DUserId, this.getDUserId(), this.isset_dUserId);
        ub.set(DUserName, this.getDUserName(), this.isset_dUserName);
        return ub.genArraySql(where, parameters);
    }
@@ -201,13 +246,15 @@
        return sb.genMapSql();
    }
    /**
     * 获取查询语句和参数
     */
    @Override
    public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) {
        return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id from " + this.getTableName_() + " " + where, parameters);
        return new SqlAndParameters<>(
            "select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from "
                + this.getTableName_() + " " + where,
            parameters);
    }
    /**
@@ -215,7 +262,10 @@
     */
    @Override
    public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
        return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id from " + this.getTableName_() + " " + where, parameters);
        return new SqlAndParameters<>(
            "select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from "
                + this.getTableName_() + " " + where,
            parameters);
    }
    /**
@@ -246,12 +296,12 @@
        ResultSetUtils resultSetUtils = new ResultSetUtils();
        BaseCategory base_category = new BaseCategory();
        Integer columnIndex;
        //主键
        // 主键
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.Id);
        if (columnIndex > 0) {
            base_category.setId(rs.getLong(columnIndex));
        }
        //普通属性
        // 普通属性
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CategoryName);
        if (columnIndex > 0) {
            base_category.setCategoryName(rs.getString(columnIndex));
@@ -292,6 +342,46 @@
                base_category.setFatherCategoryId(rs.getLong(columnIndex));
            }
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateUserId);
        if (columnIndex > 0) {
            if (rs.getBigDecimal(columnIndex) == null) {
                base_category.setCreateUserId(null);
            } else {
                base_category.setCreateUserId(rs.getLong(columnIndex));
            }
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateTime);
        if (columnIndex > 0) {
            if (rs.getBigDecimal(columnIndex) == null) {
                base_category.setCreateTime(null);
            } else {
                base_category.setCreateTime(rs.getLong(columnIndex));
            }
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateUserName);
        if (columnIndex > 0) {
            base_category.setCreateUserName(rs.getString(columnIndex));
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DTime);
        if (columnIndex > 0) {
            if (rs.getBigDecimal(columnIndex) == null) {
                base_category.setDTime(null);
            } else {
                base_category.setDTime(rs.getLong(columnIndex));
            }
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DUserId);
        if (columnIndex > 0) {
            if (rs.getBigDecimal(columnIndex) == null) {
                base_category.setDUserId(null);
            } else {
                base_category.setDUserId(rs.getLong(columnIndex));
            }
        }
        columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DUserName);
        if (columnIndex > 0) {
            base_category.setDUserName(rs.getString(columnIndex));
        }
        return base_category;
    }
}