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.DeleteBuilder; import com.walker.jdbc.sqlgen.InsertBuilder; import com.walker.jdbc.sqlgen.SelectBuilder; import com.walker.jdbc.sqlgen.UpdateBuilder; /** * 表名:L_WH_FORM_SCRAPPED_GOODS * * @author genrator */ public class LWhFormScrappedGoods_mapper extends LWhFormScrappedGoods implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new LWhFormScrappedGoodsRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String Counts = "counts"; public static final String ScrappedCode = "scrapped_code"; public static final String ScrappedName = "scrapped_name"; public static final String Beiz = "beiz"; public static final String FormScrappedId = "form_scrapped_id"; public static final String BaseGoodsTemplateId = "base_goods_template_id"; public static final String GoodsTemplateName = "goods_template_name"; public static final String Unit = "unit"; public static final String BaseGoodsModelsId = "base_goods_models_id"; public static final String BaseGoodsModelsName = "base_goods_models_name"; public static final String TransBusinessId = "trans_business_id"; public static final String UserName = "user_name"; public static final String Sort = "sort"; public static final String TotalAmount = "total_amount"; /** * 默认构造函数 */ public LWhFormScrappedGoods_mapper(LWhFormScrappedGoods lWhFormScrappedGoods) { if (lWhFormScrappedGoods == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (lWhFormScrappedGoods.isset_id) { this.setId(lWhFormScrappedGoods.getId()); } //普通属性 if (lWhFormScrappedGoods.isset_counts) { this.setCounts(lWhFormScrappedGoods.getCounts()); } if (lWhFormScrappedGoods.isset_scrappedCode) { this.setScrappedCode(lWhFormScrappedGoods.getScrappedCode()); } if (lWhFormScrappedGoods.isset_scrappedName) { this.setScrappedName(lWhFormScrappedGoods.getScrappedName()); } if (lWhFormScrappedGoods.isset_beiz) { this.setBeiz(lWhFormScrappedGoods.getBeiz()); } if (lWhFormScrappedGoods.isset_formScrappedId) { this.setFormScrappedId(lWhFormScrappedGoods.getFormScrappedId()); } if (lWhFormScrappedGoods.isset_baseGoodsTemplateId) { this.setBaseGoodsTemplateId(lWhFormScrappedGoods.getBaseGoodsTemplateId()); } if (lWhFormScrappedGoods.isset_goodsTemplateName) { this.setGoodsTemplateName(lWhFormScrappedGoods.getGoodsTemplateName()); } if (lWhFormScrappedGoods.isset_unit) { this.setUnit(lWhFormScrappedGoods.getUnit()); } if (lWhFormScrappedGoods.isset_baseGoodsModelsId) { this.setBaseGoodsModelsId(lWhFormScrappedGoods.getBaseGoodsModelsId()); } if (lWhFormScrappedGoods.isset_baseGoodsModelsName) { this.setBaseGoodsModelsName(lWhFormScrappedGoods.getBaseGoodsModelsName()); } if (lWhFormScrappedGoods.isset_transBusinessId) { this.setTransBusinessId(lWhFormScrappedGoods.getTransBusinessId()); } if (lWhFormScrappedGoods.isset_userName) { this.setUserName(lWhFormScrappedGoods.getUserName()); } if (lWhFormScrappedGoods.isset_sort) { this.setSort(lWhFormScrappedGoods.getSort()); } if (lWhFormScrappedGoods.isset_totalAmount) { this.setTotalAmount(lWhFormScrappedGoods.getTotalAmount()); } // 去掉,2022-09-07 // this.setDatabaseName_(l_wh_form_scrapped_goods.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "l_wh_form_scrapped_goods"; /** if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } else { return tableName; } */ return tableName; } /** * 获取主键名称 */ @Override public String getPkName_() { return Id; } /** * 获取主键值 */ @Override public Object getPkValue_() { return this.getId(); } /** * 获取插入语句和参数 */ @Override public SqlAndParameters> getInsertSql_() { InsertBuilder ib = new InsertBuilder(this.getTableName_()); ib.set(Id, this.getId()); ib.set(Counts, this.getCounts(), this.isset_counts); ib.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ib.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ib.set(Beiz, this.getBeiz(), this.isset_beiz); ib.set(FormScrappedId, this.getFormScrappedId(), this.isset_formScrappedId); ib.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ib.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ib.set(Unit, this.getUnit(), this.isset_unit); ib.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ib.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ib.set(UserName, this.getUserName(), this.isset_userName); ib.set(Sort, this.getSort(), this.isset_sort); ib.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(FormScrappedId, this.getFormScrappedId(), this.isset_formScrappedId); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(UserName, this.getUserName(), this.isset_userName); ub.set(Sort, this.getSort(), this.isset_sort); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); ub.where(this.getPkName_(), this.getPkValue_()); return ub.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_(String where, Map parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(FormScrappedId, this.getFormScrappedId(), this.isset_formScrappedId); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(UserName, this.getUserName(), this.isset_userName); ub.set(Sort, this.getSort(), this.isset_sort); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(Counts, this.getCounts(), this.isset_counts); ub.set(ScrappedCode, this.getScrappedCode(), this.isset_scrappedCode); ub.set(ScrappedName, this.getScrappedName(), this.isset_scrappedName); ub.set(Beiz, this.getBeiz(), this.isset_beiz); ub.set(FormScrappedId, this.getFormScrappedId(), this.isset_formScrappedId); ub.set(BaseGoodsTemplateId, this.getBaseGoodsTemplateId(), this.isset_baseGoodsTemplateId); ub.set(GoodsTemplateName, this.getGoodsTemplateName(), this.isset_goodsTemplateName); ub.set(Unit, this.getUnit(), this.isset_unit); ub.set(BaseGoodsModelsId, this.getBaseGoodsModelsId(), this.isset_baseGoodsModelsId); ub.set(BaseGoodsModelsName, this.getBaseGoodsModelsName(), this.isset_baseGoodsModelsName); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(UserName, this.getUserName(), this.isset_userName); ub.set(Sort, this.getSort(), this.isset_sort); ub.set(TotalAmount, this.getTotalAmount(), this.isset_totalAmount); return ub.genArraySql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_() { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); db.where(this.getPkName_(), this.getPkValue_()); return db.genMapSql(); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_(String where, Map parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genMapSql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters getDeleteSql_(String where, Object[] parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genArraySql(where, parameters); } /** * 获取单行查询语句和参数 */ @Override public SqlAndParameters> getSingleSql_() { SelectBuilder sb = new SelectBuilder(this.getTableName_()); sb.where(this.getPkName_(), this.getPkValue_()); return sb.genMapSql(); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters> getSelectSql_(String where, Map parameters) { return new SqlAndParameters<>("select id, counts, scrapped_code, scrapped_name, beiz, form_scrapped_id, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, trans_business_id, user_name, sort, total_amount from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, counts, scrapped_code, scrapped_name, beiz, form_scrapped_id, base_goods_template_id, goods_template_name, unit, base_goods_models_id, base_goods_models_name, trans_business_id, user_name, sort, total_amount from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public LWhFormScrappedGoods mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public LWhFormScrappedGoods toLWhFormScrappedGoods() { return super.$clone(); } } /** * l_wh_form_scrapped_goods RowMapper * * @author genrator */ class LWhFormScrappedGoodsRowMapper implements RowMapper { @Override public LWhFormScrappedGoods mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); LWhFormScrappedGoods l_wh_form_scrapped_goods = new LWhFormScrappedGoods(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.Id); if (columnIndex > 0) { l_wh_form_scrapped_goods.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.Counts); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setCounts(null); } else { l_wh_form_scrapped_goods.setCounts(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.ScrappedCode); if (columnIndex > 0) { l_wh_form_scrapped_goods.setScrappedCode(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.ScrappedName); if (columnIndex > 0) { l_wh_form_scrapped_goods.setScrappedName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.Beiz); if (columnIndex > 0) { l_wh_form_scrapped_goods.setBeiz(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.FormScrappedId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setFormScrappedId(null); } else { l_wh_form_scrapped_goods.setFormScrappedId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.BaseGoodsTemplateId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setBaseGoodsTemplateId(null); } else { l_wh_form_scrapped_goods.setBaseGoodsTemplateId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.GoodsTemplateName); if (columnIndex > 0) { l_wh_form_scrapped_goods.setGoodsTemplateName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.Unit); if (columnIndex > 0) { l_wh_form_scrapped_goods.setUnit(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.BaseGoodsModelsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setBaseGoodsModelsId(null); } else { l_wh_form_scrapped_goods.setBaseGoodsModelsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.BaseGoodsModelsName); if (columnIndex > 0) { l_wh_form_scrapped_goods.setBaseGoodsModelsName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.TransBusinessId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setTransBusinessId(null); } else { l_wh_form_scrapped_goods.setTransBusinessId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.UserName); if (columnIndex > 0) { l_wh_form_scrapped_goods.setUserName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.Sort); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setSort(null); } else { l_wh_form_scrapped_goods.setSort(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LWhFormScrappedGoods_mapper.TotalAmount); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_wh_form_scrapped_goods.setTotalAmount(null); } else { l_wh_form_scrapped_goods.setTotalAmount(rs.getInt(columnIndex)); } } return l_wh_form_scrapped_goods; } }