| | |
| | | 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; |
| | |
| | | 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_GOODS_TEMPLATE * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseGoodsTemplate_mapper extends BaseGoodsTemplate implements BaseMapper<BaseGoodsTemplate> { |
| | |
| | | if (baseGoodsTemplate == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseGoodsTemplate.isset_id) { |
| | | this.setId(baseGoodsTemplate.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseGoodsTemplate.isset_goodsCode) { |
| | | this.setGoodsCode(baseGoodsTemplate.getGoodsCode()); |
| | | } |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_goods_template"; |
| | | /** |
| | | 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; |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseGoodsTemplate base_goods_template = new BaseGoodsTemplate(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_goods_template.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.GoodsCode); |
| | | if (columnIndex > 0) { |
| | | base_goods_template.setGoodsCode(rs.getString(columnIndex)); |