类org.apache.ibatis.annotations.Insert源码实例Demo

下面列出了怎么用org.apache.ibatis.annotations.Insert的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: sds   文件: PointStrategyDao.java
/**
 * 批量新增降级点策略
 *
 * @param strategyDOList
 * @return
 */
@Insert("<script> insert into point_strategy (app_group_name, app_name, point, sds_scheme_name, "
        + "visit_threshold, " +
        "concurrent_threshold, exception_threshold, exception_rate_threshold, exception_rate_start, "
        + "timeout_threshold, " +
        "timeout_count_threshold, token_bucket_generated_tokens_in_second, token_bucket_size, delay_time, "
        + "retry_interval, downgrade_rate, pressure_test_downgrade, status, operator_name, operator_email, "
        + "creator_name, creator_email) " +
        "values " +
        "<foreach collection=\"strategyDOList\" item=\"strategyDO\" separator=\",\" open=\"(\" close=\")\" >" +
        "#{strategyDO.appGroupName}, #{strategyDO.appName}, #{strategyDO.point}, #{strategyDO.sdsSchemeName},"
        + " #{strategyDO.visitThreshold}, #{strategyDO.concurrentThreshold}, " +
        "#{strategyDO.exceptionThreshold}, #{strategyDO.exceptionRateThreshold}, #{strategyDO"
        + ".exceptionRateStart}, #{strategyDO.timeoutThreshold}, #{strategyDO.timeoutCountThreshold}, " +
        "#{strategyDO.tokenBucketGeneratedTokensInSecond}, #{strategyDO.tokenBucketSize}, #{strategyDO"
        + ".delayTime}, #{strategyDO.retryInterval}, #{strategyDO.downgradeRate},  #{strategyDO"
        + ".pressureTestDowngrade}, #{strategyDO.status}, " +
        "#{strategyDO.operatorName}, #{strategyDO.operatorEmail}, #{strategyDO.creatorName}, #{strategyDO"
        + ".creatorEmail}" +
        " </foreach>" +
        " </script>")
int addPointStrategyBatch(List<PointStrategyDO> strategyDOList);
 
源代码2 项目: hmdm-server   文件: CommonMapper.java
@Insert({
        "INSERT INTO settings (" +
                "backgroundColor, " +
                "textColor, " +
                "backgroundImageUrl, " +
                "iconSize, " +
                "desktopHeader, " +
                "customerId" +
                ") VALUES (" +
                "#{backgroundColor}, " +
                "#{textColor}, " +
                "#{backgroundImageUrl}, " +
                "#{iconSize}, " +
                "#{desktopHeader}, " +
                "#{customerId}" +
                ") " +
                "ON CONFLICT ON CONSTRAINT settings_customer_unique DO " +
                "UPDATE SET " +
                "backgroundColor = EXCLUDED.backgroundColor, " +
                "textColor = EXCLUDED.textColor, " +
                "backgroundImageUrl = EXCLUDED.backgroundImageUrl, " +
                "iconSize = EXCLUDED.iconSize, " +
                "desktopHeader = EXCLUDED.desktopHeader"
})
void saveDefaultDesignSettings(Settings settings);
 
源代码3 项目: hmdm-server   文件: CommonMapper.java
@Insert({
        "INSERT INTO settings (" +
                "useDefaultLanguage, " +
                "language, " +
                "customerId" +
                ") VALUES (" +
                "#{useDefaultLanguage}, " +
                "#{language}, " +
                "#{customerId}" +
                ") " +
                "ON CONFLICT ON CONSTRAINT settings_customer_unique DO " +
                "UPDATE SET " +
                "useDefaultLanguage = EXCLUDED.useDefaultLanguage, " +
                "language = EXCLUDED.language"
})
void saveLanguageSettings(Settings settings);
 
源代码4 项目: hmdm-server   文件: CommonMapper.java
@Insert({
        "INSERT INTO settings (" +
                "createNewDevices, " +
                "newDeviceGroupId, " +
                "newDeviceConfigurationId, " +
                "phoneNumberFormat, " +
                "customerId" +
                ") VALUES (" +
                "#{createNewDevices}, " +
                "#{newDeviceGroupId}, " +
                "#{newDeviceConfigurationId}, " +
                "#{phoneNumberFormat}, " +
                "#{customerId}" +
                ") " +
                "ON CONFLICT ON CONSTRAINT settings_customer_unique DO " +
                "UPDATE SET " +
                "createNewDevices = EXCLUDED.createNewDevices, " +
                "newDeviceGroupId = EXCLUDED.newDeviceGroupId, " +
                "newDeviceConfigurationId = EXCLUDED.newDeviceConfigurationId, " +
                "phoneNumberFormat = EXCLUDED.phoneNumberFormat"
})
void saveMiscSettings(Settings settings);
 
源代码5 项目: hmdm-server   文件: AuditMapper.java
@Insert({"INSERT INTO plugin_audit_log (" +
        "    createTime," +
        "    customerId," +
        "    userId," +
        "    login," +
        "    action," +
        "    payload," +
        "    ipAddress," +
        "    errorCode" +
        ") " +
        "VALUES (" +
        "    #{createTime}," +
        "    #{customerId}," +
        "    #{userId}," +
        "    #{login}," +
        "    #{action}," +
        "    #{payload}," +
        "    #{ipAddress}," +
        "    #{errorCode}" +
        ")"})
int insertAuditLogRecord(AuditLogRecord logRecord);
 
源代码6 项目: hmdm-server   文件: PostgresDeviceLogMapper.java
@Insert("INSERT INTO plugin_devicelog_settings_rules (" +
        "  settingId, " +
        "  name, " +
        "  active, " +
        "  applicationId, " +
        "  severity, " +
        "  filter, " +
        "  groupId, " +
        "  configurationId " +
        ") " +
        "VALUES (" +
        "  #{settingId}, " +
        "  #{name}, " +
        "  #{active}, " +
        "  #{applicationId}, " +
        "  #{severity}, " +
        "  #{filter}, " +
        "  #{groupId}, " +
        "  #{configurationId} " +
        ")")
@SelectKey( statement = "SELECT currval('plugin_devicelog_settings_rules_id_seq')",
        keyColumn = "id", keyProperty = "id", before = false, resultType = int.class )
void insertPluginSettingsRule(PostgresDeviceLogRule rule);
 
源代码7 项目: sds   文件: HeartbeatDao.java
/**
 * 新增心跳数据
 *
 * @param heartbeatDOList
 * @return
 */
@Insert("<script> insert into heartbeat(app_group_name, app_name, point, downgrade_num, visit_num, exception_num,"
        + " timeout_num, max_concurrent_num, app_ip, statistics_cycle_time)" +
        " values" +
        " <foreach collection=\"heartbeatDOList\" item=\"heartbeatDO\" separator=\",\">" +
        "( #{heartbeatDO.appGroupName}, #{heartbeatDO.appName}, #{heartbeatDO.point}, #{heartbeatDO"
        + ".downgradeNum}, #{heartbeatDO.visitNum}, " +
        "#{heartbeatDO.exceptionNum}, #{heartbeatDO.timeoutNum}, #{heartbeatDO.maxConcurrentNum}, #{heartbeatDO"
        + ".appIp}, #{heartbeatDO.statisticsCycleTime} )" +
        "</foreach> </script>")
int addHeartbeat(@Param("heartbeatDOList") List<HeartbeatDO> heartbeatDOList);
 
源代码8 项目: sds   文件: PointStrategyDao.java
/**
 * 新增降级点策略
 *
 * @param strategyDO
 * @return
 */
@Insert("<script> insert into point_strategy (app_group_name, app_name, point, sds_scheme_name, "
        + "downgrade_rate, status, operator_name, operator_email, creator_name, creator_email" +
        "<if test='visitThreshold != null'> , visit_threshold </if> " +
        "<if test='concurrentThreshold != null'> , concurrent_threshold </if> " +
        "<if test='exceptionThreshold != null'> , exception_threshold </if> " +
        "<if test='exceptionRateThreshold != null'> , exception_rate_threshold </if> " +
        "<if test='exceptionRateStart != null'> , exception_rate_start </if> " +
        "<if test='timeoutThreshold != null'> , timeout_threshold </if> " +
        "<if test='timeoutCountThreshold != null'> , timeout_count_threshold </if> " +
        "<if test='tokenBucketGeneratedTokensInSecond != null'> , token_bucket_generated_tokens_in_second </if> " +
        "<if test='tokenBucketSize != null'> , token_bucket_size </if> " +
        "<if test='delayTime != null'> , delay_time </if> " +
        "<if test='pressureTestDowngrade != null'> , pressure_test_downgrade </if> " +
        "<if test='retryInterval != null'> , retry_interval </if> ) " +
        " values(#{appGroupName}, #{appName}, #{point}, #{sdsSchemeName}, #{downgradeRate}, #{status}, "
        + "#{operatorName}, #{operatorEmail}, #{creatorName}, #{creatorEmail}" +
        "<if test='visitThreshold != null'> , #{visitThreshold}  </if> " +
        "<if test='concurrentThreshold != null'> , #{concurrentThreshold} </if> " +
        "<if test='exceptionThreshold != null'> , #{exceptionThreshold} </if> " +
        "<if test='exceptionRateThreshold != null'> , #{exceptionRateThreshold} </if> " +
        "<if test='exceptionRateStart != null'> , #{exceptionRateStart} </if> " +
        "<if test='timeoutThreshold != null'> , #{timeoutThreshold} </if> " +
        "<if test='timeoutCountThreshold != null'> , #{timeoutCountThreshold} </if> " +
        "<if test='tokenBucketGeneratedTokensInSecond != null'> , #{tokenBucketGeneratedTokensInSecond} </if> " +
        "<if test='tokenBucketSize != null'> , #{tokenBucketSize} </if> " +
        "<if test='delayTime != null'> , #{delayTime} </if> " +
        "<if test='pressureTestDowngrade != null'> , #{pressureTestDowngrade} </if> " +
        "<if test='retryInterval != null'> , #{retryInterval} </if> )" +
        " </script>")
int addPointStrategy(PointStrategyDO strategyDO);
 
源代码9 项目: sds   文件: UserPrivilegeDao.java
/**
 * 给某个用户新增权限
 *
 * @param userName
 * @param appGroupName
 * @param appName
 * @return
 */
@Insert("<script> insert into user_privilege(user_name, app_group_name, app_name) " +
        "values" +
        "<foreach collection=\"appNameList\" start=\"(\" end=\")\" item=\"appName\">" +
        "#{userName}, #{appGroupName}, #{appName}" +
        "</foreach>" +
        " </script>")
int addUserPrivilege(@Param("userName") String userName,
                     @Param("userPrivilegeList") List<UserPrivilege> userPrivilegeList);
 
源代码10 项目: Spring-Boot-Book   文件: UserMapper.java
@Insert("insert into user(name,age) values(#{name},#{age})")
int addUser(@Param("name")String name,@Param("age")String age);
 
源代码11 项目: Spring-Boot-Book   文件: UserMapper.java
@Insert("insert into user(name,age) values(#{name},#{age})")
int addUser(@Param("name")String name,@Param("age")String age);
 
源代码12 项目: open-capacity-platform   文件: SmsDao.java
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_sms(phone, signName, templateCode, params, day, createTime, updateTime) "
		+ "values(#{phone}, #{signName}, #{templateCode}, #{params}, #{day}, #{createTime}, #{updateTime})")
int save(Sms sms);
 
源代码13 项目: open-capacity-platform   文件: FileDao.java
@Insert("insert into file_info(id, name, isImg, contentType, size, path, url, source, createTime) "
		+ "values(#{id}, #{name}, #{isImg}, #{contentType}, #{size}, #{path}, #{url}, #{source}, #{createTime})")
int save(FileInfo fileInfo);
 
源代码14 项目: open-capacity-platform   文件: SysMenuDao.java
@Insert("insert into sys_menu(parentId, name, url, path, css, sort, createTime, updateTime,isMenu,hidden) "
		+ "values (#{parentId}, #{name}, #{url} , #{path} , #{css}, #{sort}, #{createTime}, #{updateTime},#{isMenu},#{hidden})")
int save(SysMenu menu);
 
源代码15 项目: open-capacity-platform   文件: SysPermissionDao.java
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_permission(permission, name, createTime, updateTime) values(#{permission}, #{name}, #{createTime}, #{createTime})")
int save(SysPermission sysPermission);
 
源代码16 项目: open-capacity-platform   文件: SysRoleMenuDao.java
@Insert("insert into sys_role_menu(roleId, menuId) values(#{roleId}, #{menuId})")
int save(@Param("roleId") Long roleId, @Param("menuId") Long menuId);
 
@Insert("insert into sys_role_permission(roleId, permissionId) values(#{roleId}, #{permissionId})")
int saveRolePermission(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);
 
源代码18 项目: open-capacity-platform   文件: SysTest2Dao.java
@Insert("insert into sys_test(username ) "
		+ "values ('test' )")
int save(Map<String,String> params);
 
源代码19 项目: open-capacity-platform   文件: SysUserDao.java
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_user(username, password, nickname, headImgUrl, phone, sex, enabled, type, createTime, updateTime) "
		+ "values(#{username}, #{password}, #{nickname}, #{headImgUrl}, #{phone}, #{sex}, #{enabled}, #{type}, #{createTime}, #{updateTime})")
int save(SysUser sysUser);
 
源代码20 项目: open-capacity-platform   文件: SysRoleDao.java
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_role(code, name, createTime, updateTime) values(#{code}, #{name}, #{createTime}, #{createTime})")
int save(SysRole sysRole);
 
源代码21 项目: open-capacity-platform   文件: SysTes1tDao.java
@Insert("insert into sys_test(username ) "
		+ "values ('test' )")
int save(Map<String,String> params);
 
源代码22 项目: open-capacity-platform   文件: SysUserRoleDao.java
@Insert("insert into sys_role_user(userId, roleId) values(#{userId}, #{roleId})")
int saveUserRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);
 
源代码23 项目: open-capacity-platform   文件: LogDao.java
@Insert("insert into sys_log(username, module, params, remark, flag, createTime) values(#{username}, #{module}, #{params}, #{remark}, #{flag}, #{createTime})")
int save(SysLog log);
 
@Insert("insert into sys_client_service(clientId, serviceId) values(#{clientId}, #{serviceId})")
int save(@Param("clientId") Long clientId, @Param("serviceId") Long serviceId);
 
源代码25 项目: pre   文件: SysRoleMapper.java
@Insert("insert into sys_role (role_name,role_code,role_desc,ds_type,ds_scope) values (#{roleName}, #{roleCode},#{roleDesc},#{dsType},#{dsScope})")
@Options(useGeneratedKeys=true, keyProperty="roleId", keyColumn="role_id")
Boolean insertRole(SysRole sysRole);
 
源代码26 项目: open-capacity-platform   文件: ClientDao.java
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into oauth_client_details(client_id, resource_ids, client_secret,client_secret_str, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove) values(#{clientId}, #{resourceIds}, #{clientSecret},#{clientSecretStr}, #{scope}, #{authorizedGrantTypes}, #{webServerRedirectUri}, #{authorities}, #{accessTokenValidity}, #{refreshTokenValidity}, #{additionalInformation}, #{autoapprove})")
int save(Client client);
 
@Insert("INSERT INTO plugin1 VALUES (#{id}, #{name})")
void insert(@Param("id") String id, @Param("name") String name);
 
@Insert("INSERT INTO plugin1 VALUES (#{id}, #{name})")
void insert(@Param("id") String id, @Param("name") String name);
 
@Insert("INSERT INTO plugin2 VALUES (#{id}, #{name})")
void save(@Param("id") String id, @Param("name") String name);
 
源代码30 项目: Demo   文件: StudentMapper.java
@Insert("insert into student(name, age) values(#{name}, #{age})")
int add(Student student);