gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
class MBomDO( var id: Long? = null, // 成品物料编号 var materialCode: String? = null, // 版本号…
- User
class MBomDO( var id: Long? = null, // 成品物料编号 var materialCode: String? = null,
// 版本号 默认 var version: String? = null, // 级别 var leve: Int? = 1, // 行号 var lineNum: Int? = null, // 物料编码 var code: String? = null, // 工艺路线 var routing: String = "", // 主单位 var unit: String? = null, var amountOne: Int? = 1, var amountTwo: Int? = 1, // 上层物料编码 var parentCode: String? = null,) 使用kotlin 帮我生成这个对象的mapper 包含新增,修改,查询
- Assistant
@Mapper interface MBomMapper {
@Insert("INSERT INTO MBomDO(materialCode, version, leve, lineNum, code, routing, unit, amountOne, amountTwo, parentCode) VALUES(#{materialCode}, #{version}, #{leve}, #{lineNum}, #{code}, #{routing}, #{unit}, #{amountOne}, #{amountTwo}, #{parentCode})") @Options(useGeneratedKeys = true, keyProperty = "id") fun addMBom(mBom: MBomDO): Int @Update("UPDATE MBomDO SET materialCode = #{materialCode}, version = #{version}, leve = #{leve}, lineNum = #{lineNum}, code = #{code}, routing = #{routing}, unit = #{unit}, amountOne = #{amountOne}, amountTwo = #{amountTwo}, parentCode = #{parentCode} WHERE id = #{id}") fun updateMBom(mBom: MBomDO): Int @Select("SELECT * FROM MBomDO WHERE id = #{id}") fun getMBomById(id: Long): MBomDO?}
- User
class MBomDO( var id: Long? = null, // 成品物料编号 var materialCode: String? = null,
// 版本号 默认 var version: String? = null,
// 级别 var leve: Int? = 1,
// 行号 var lineNum: Int? = null,
// 物料编码 var code: String? = null,
// 工艺路线 var routing: String = “”,
// 主单位 var unit: String? = null,
var amountOne: Int? = 1,
var amountTwo: Int? = 1,
// 上层物料编码 var parentCode: String? = null,
) 使用kotlin 帮我生成这个对象的mapper 包含批量新增,批量修改,查询
- Assistant
@Mapper interface MBomMapper {
@Insert("<script>" + "INSERT INTO MBomDO(materialCode, version, leve, lineNum, code, routing, unit, amountOne, amountTwo, parentCode)" + "VALUES" + "<foreach collection='mBomList' item='item' separator=','>" + "(#{item.materialCode}, #{item.version}, #{item.leve}, #{item.lineNum}, #{item.code}, #{item.routing}, #{item.unit}, #{item.amountOne}, #{item.amountTwo}, #{item.parentCode})" + "</foreach>" + "</script>") fun batchAddMBom(mBomList: List<MBomDO>): Int @Update("<script>" + "<foreach collection='mBomList' item='item' separator=';'>" + "UPDATE MBomDO SET materialCode = #{item.materialCode}, version = #{item.version}, leve = #{item.leve}, lineNum = #{item.lineNum}, code = #{item.code}, routing = #{item.routing}, unit = #{item.unit}, amountOne = #{item.amountOne}, amountTwo = #{item.amountTwo}, parentCode = #{item.parentCode} WHERE id = #{item.id};" + "</foreach>" + "</script>") fun batchUpdateMBom(mBomList: List<MBomDO>): Int @Select("<script>" + "SELECT * FROM MBomDO" + "<where>" + "<if test='id != null'>" + "AND id = #{id}" + "</if>" + "<if test='materialCode != null'>" + "AND materialCode = #{materialCode}" + "</if>" + "<if test='code != null'>" + "AND code = #{code}" + "</if>" + "<if test='parentCode != null'>" + "AND parentCode = #{parentCode}" + "</if>" + "</where>" + "</script>") fun getMBomList(id: Long?, materialCode: String?, code: String?, parentCode: String?): List<MBomDO>