| | |
| | | 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; |
| | |
| | | // 主键 |
| | | public static final String Id = "id"; |
| | | // 普通属性 |
| | | public static final String LWhGoodsRecordId = "l_wh_goods_record_id"; |
| | | public static final String LWhGoodsId = "l_wh_goods_id"; |
| | | public static final String WhGoodsRecordId = "wh_goods_record_id"; |
| | | public static final String WhGoodsId = "wh_goods_id"; |
| | | public static final String ThisType = "this_type"; |
| | | |
| | | /** |
| | |
| | | this.setId(lWhGoodsRecordDetails.getId()); |
| | | } |
| | | //普通属性 |
| | | if (lWhGoodsRecordDetails.isset_lWhGoodsRecordId) { |
| | | this.setLWhGoodsRecordId(lWhGoodsRecordDetails.getLWhGoodsRecordId()); |
| | | if (lWhGoodsRecordDetails.isset_whGoodsRecordId) { |
| | | this.setWhGoodsRecordId(lWhGoodsRecordDetails.getWhGoodsRecordId()); |
| | | } |
| | | if (lWhGoodsRecordDetails.isset_lWhGoodsId) { |
| | | this.setLWhGoodsId(lWhGoodsRecordDetails.getLWhGoodsId()); |
| | | if (lWhGoodsRecordDetails.isset_whGoodsId) { |
| | | this.setWhGoodsId(lWhGoodsRecordDetails.getWhGoodsId()); |
| | | } |
| | | if (lWhGoodsRecordDetails.isset_thisType) { |
| | | this.setThisType(lWhGoodsRecordDetails.getThisType()); |
| | |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(LWhGoodsRecordId, this.getLWhGoodsRecordId(), this.isset_lWhGoodsRecordId); |
| | | ib.set(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId); |
| | | ib.set(WhGoodsRecordId, this.getWhGoodsRecordId(), this.isset_whGoodsRecordId); |
| | | ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ib.set(ThisType, this.getThisType(), this.isset_thisType); |
| | | return ib.genMapSql(); |
| | | } |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWhGoodsRecordId, this.getLWhGoodsRecordId(), this.isset_lWhGoodsRecordId); |
| | | ub.set(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId); |
| | | ub.set(WhGoodsRecordId, this.getWhGoodsRecordId(), this.isset_whGoodsRecordId); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(ThisType, this.getThisType(), this.isset_thisType); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWhGoodsRecordId, this.getLWhGoodsRecordId(), this.isset_lWhGoodsRecordId); |
| | | ub.set(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId); |
| | | ub.set(WhGoodsRecordId, this.getWhGoodsRecordId(), this.isset_whGoodsRecordId); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(ThisType, this.getThisType(), this.isset_thisType); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | |
| | | @Override |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWhGoodsRecordId, this.getLWhGoodsRecordId(), this.isset_lWhGoodsRecordId); |
| | | ub.set(LWhGoodsId, this.getLWhGoodsId(), this.isset_lWhGoodsId); |
| | | ub.set(WhGoodsRecordId, this.getWhGoodsRecordId(), this.isset_whGoodsRecordId); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(ThisType, this.getThisType(), this.isset_thisType); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, l_wh_goods_record_id, l_wh_goods_id, this_type from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, wh_goods_record_id, wh_goods_id, this_type from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, l_wh_goods_record_id, l_wh_goods_id, this_type from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, wh_goods_record_id, wh_goods_id, this_type from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | l_wh_goods_record_details.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecordDetails_mapper.LWhGoodsRecordId); |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecordDetails_mapper.WhGoodsRecordId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_goods_record_details.setLWhGoodsRecordId(null); |
| | | l_wh_goods_record_details.setWhGoodsRecordId(null); |
| | | } else { |
| | | l_wh_goods_record_details.setLWhGoodsRecordId(rs.getLong(columnIndex)); |
| | | l_wh_goods_record_details.setWhGoodsRecordId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecordDetails_mapper.LWhGoodsId); |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecordDetails_mapper.WhGoodsId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_goods_record_details.setLWhGoodsId(null); |
| | | l_wh_goods_record_details.setWhGoodsId(null); |
| | | } else { |
| | | l_wh_goods_record_details.setLWhGoodsId(rs.getLong(columnIndex)); |
| | | l_wh_goods_record_details.setWhGoodsId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecordDetails_mapper.ThisType); |