org.apache.ibatis.annotations.Insert Java Examples

The following examples show how to use org.apache.ibatis.annotations.Insert. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: sds   Author: didi   File: PointStrategyDao.java    License: Apache License 2.0 8 votes vote down vote up
/**
 * 批量新增降级点策略
 *
 * @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);
 
Example #2
Source Project: hmdm-server   Author: h-mdm   File: CommonMapper.java    License: Apache License 2.0 6 votes vote down vote up
@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);
 
Example #3
Source Project: hmdm-server   Author: h-mdm   File: CommonMapper.java    License: Apache License 2.0 6 votes vote down vote up
@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);
 
Example #4
Source Project: hmdm-server   Author: h-mdm   File: CommonMapper.java    License: Apache License 2.0 6 votes vote down vote up
@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);
 
Example #5
Source Project: hmdm-server   Author: h-mdm   File: AuditMapper.java    License: Apache License 2.0 6 votes vote down vote up
@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);
 
Example #6
Source Project: hmdm-server   Author: h-mdm   File: PostgresDeviceLogMapper.java    License: Apache License 2.0 6 votes vote down vote up
@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);
 
Example #7
Source Project: sds   Author: didi   File: HeartbeatDao.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 新增心跳数据
 *
 * @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);
 
Example #8
Source Project: sds   Author: didi   File: PointStrategyDao.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 新增降级点策略
 *
 * @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);
 
Example #9
Source Project: sds   Author: didi   File: UserPrivilegeDao.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 给某个用户新增权限
 *
 * @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);
 
Example #10
Source Project: Spring-Boot-Book   Author: xiuhuai   File: UserMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into user(name,age) values(#{name},#{age})")
int addUser(@Param("name")String name,@Param("age")String age);
 
Example #11
Source Project: Spring-Boot-Book   Author: xiuhuai   File: UserMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into user(name,age) values(#{name},#{age})")
int addUser(@Param("name")String name,@Param("age")String age);
 
Example #12
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SmsDao.java    License: Apache License 2.0 4 votes vote down vote up
@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);
 
Example #13
Source Project: open-capacity-platform   Author: open-capacity-platform   File: FileDao.java    License: Apache License 2.0 4 votes vote down vote up
@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);
 
Example #14
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysMenuDao.java    License: Apache License 2.0 4 votes vote down vote up
@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);
 
Example #15
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysPermissionDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_permission(permission, name, createTime, updateTime) values(#{permission}, #{name}, #{createTime}, #{createTime})")
int save(SysPermission sysPermission);
 
Example #16
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysRoleMenuDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_role_menu(roleId, menuId) values(#{roleId}, #{menuId})")
int save(@Param("roleId") Long roleId, @Param("menuId") Long menuId);
 
Example #17
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysRolePermissionDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_role_permission(roleId, permissionId) values(#{roleId}, #{permissionId})")
int saveRolePermission(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);
 
Example #18
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysTest2Dao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_test(username ) "
		+ "values ('test' )")
int save(Map<String,String> params);
 
Example #19
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysUserDao.java    License: Apache License 2.0 4 votes vote down vote up
@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);
 
Example #20
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysRoleDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_role(code, name, createTime, updateTime) values(#{code}, #{name}, #{createTime}, #{createTime})")
int save(SysRole sysRole);
 
Example #21
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysTes1tDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_test(username ) "
		+ "values ('test' )")
int save(Map<String,String> params);
 
Example #22
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysUserRoleDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_role_user(userId, roleId) values(#{userId}, #{roleId})")
int saveUserRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);
 
Example #23
Source Project: open-capacity-platform   Author: open-capacity-platform   File: LogDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_log(username, module, params, remark, flag, createTime) values(#{username}, #{module}, #{params}, #{remark}, #{flag}, #{createTime})")
int save(SysLog log);
 
Example #24
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysClientServiceDao.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into sys_client_service(clientId, serviceId) values(#{clientId}, #{serviceId})")
int save(@Param("clientId") Long clientId, @Param("serviceId") Long serviceId);
 
Example #25
Source Project: pre   Author: LiHaodong888   File: SysRoleMapper.java    License: GNU General Public License v3.0 4 votes vote down vote up
@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);
 
Example #26
Source Project: open-capacity-platform   Author: open-capacity-platform   File: ClientDao.java    License: Apache License 2.0 4 votes vote down vote up
@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);
 
Example #27
Source Project: springboot-plugin-framework-parent   Author: starblues-zhuo   File: RoleMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("INSERT INTO plugin1 VALUES (#{id}, #{name})")
void insert(@Param("id") String id, @Param("name") String name);
 
Example #28
Source Project: springboot-plugin-framework-parent   Author: starblues-zhuo   File: Plugin1Mapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("INSERT INTO plugin1 VALUES (#{id}, #{name})")
void insert(@Param("id") String id, @Param("name") String name);
 
Example #29
Source Project: springboot-plugin-framework-parent   Author: starblues-zhuo   File: Plugin2Mapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("INSERT INTO plugin2 VALUES (#{id}, #{name})")
void save(@Param("id") String id, @Param("name") String name);
 
Example #30
Source Project: Demo   Author: turoDog   File: StudentMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("insert into student(name, age) values(#{name}, #{age})")
int add(Student student);