@Insert("<script>"
+ "insert into ms_organization "
+ "<trim prefix='(' suffix=')' suffixOverrides=','>"
+ "corp_id, "
+ "<if test = \"root >= 0 \"> root, </if>"
+ "<if test = \"category !=null and category != ''\"> category, </if>"
+ "<if test = \"type !=null and type != ''\"> type, </if>"
+ "<if test = \"name !=null and name != ''\"> name, </if>"
+ "<if test = \"label !=null and label != ''\"> label, </if> "
// + "<if test = \"socialCreditCode !=null and socialCreditCode != ''\"> social_credit_code, </if> "
// + "<if test = \"areaCode !=null and areaCode != ''\"> area_code, </if> "
// + "<if test = \"linkMan !=null and linkMan != ''\"> link_man, </if> "
// + "<if test = \"linkPhone !=null and linkPhone != ''\"> link_phone, </if> "
// + "<if test = \"description !=null and description != ''\"> description, </if>"
+ "</trim>"
+ "<trim prefix='VALUES(' suffix=')' suffixOverrides=','>"
+ " #{corpId, jdbcType=INTEGER}, "
+ "<if test = \"root >= 0 \"> #{root, jdbcType=INTEGER}, </if>"
+ "<if test = \"category !=null and category != ''\"> #{category, jdbcType=VARCHAR}, </if>"
+ "<if test = \"type !=null and type != ''\"> #{type, jdbcType=VARCHAR}, </if>"
+ "<if test = \"name !=null and name != ''\"> #{name, jdbcType=VARCHAR}, </if>"
+ "<if test = \"label !=null and label != ''\"> #{label, jdbcType=VARCHAR}, </if>"
// + "<if test = \"socialCreditCode !=null and socialCreditCode != ''\"> #{socialCreditCode, jdbcType=VARCHAR}, </if>"
// + "<if test = \"areaCode !=null and areaCode != ''\"> #{areaCode, jdbcType=VARCHAR}, </if>"
// + "<if test = \"linkMan !=null and linkMan != ''\"> #{linkMan, jdbcType=VARCHAR}, </if>"
// + "<if test = \"linkPhone !=null and linkPhone != ''\"> #{linkPhone, jdbcType=VARCHAR}, </if>"
// + "<if test = \"description !=null and description != ''\"> #{description, jdbcType=VARCHAR}, </if>"
+ "</trim>"
+ "</script>")
@Options(useGeneratedKeys = true, keyProperty = "orgId", keyColumn = "id")
int insertOrganizations(OriganizationsReq reqEntity);
插入主键自增赋值
最新推荐文章于 2021-05-13 11:20:35 发布