org.apache.ibatis.annotations.Update Java Examples

The following examples show how to use org.apache.ibatis.annotations.Update. 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 File: PointStrategyDao.java    From sds with Apache License 2.0 6 votes vote down vote up
/**
 * 更新降级点策略
 *
 * @param strategyDO
 * @return
 */
@Update("<script> update point_strategy <set> " +
        " sds_scheme_name = #{newSdsSchemeName}, status = #{status}, operator_name = #{operatorName}, "
        + "operator_email = #{operatorEmail}  " +
        "<if test='visitThreshold != null'> , visit_threshold = #{visitThreshold} </if> " +
        "<if test='concurrentThreshold != null'> , concurrent_threshold = #{concurrentThreshold} </if> " +
        "<if test='exceptionThreshold != null'> , exception_threshold = #{exceptionThreshold} </if> " +
        "<if test='exceptionRateThreshold != null'> , exception_rate_threshold = #{exceptionRateThreshold} </if> " +
        "<if test='exceptionRateStart != null'> , exception_rate_start = #{exceptionRateStart} </if> " +
        "<if test='timeoutThreshold != null'> , timeout_threshold = #{timeoutThreshold} </if> " +
        "<if test='timeoutCountThreshold != null'> , timeout_count_threshold = #{timeoutCountThreshold} </if> " +
        "<if test='tokenBucketGeneratedTokensInSecond != null'> , token_bucket_generated_tokens_in_second = "
        + "#{tokenBucketGeneratedTokensInSecond} </if> " +
        "<if test='tokenBucketSize != null'> , token_bucket_size = #{tokenBucketSize} </if> " +
        "<if test='delayTime != null'> , delay_time = #{delayTime} </if> " +
        "<if test='retryInterval != null'> , retry_interval = #{retryInterval} </if> " +
        "<if test='downgradeRate != null'> , downgrade_rate = #{downgradeRate} </if> " +
        "<if test='pressureTestDowngrade != null'> , pressure_test_downgrade = #{pressureTestDowngrade} </if> " +
        " </set> " +
        " where app_group_name = #{appGroupName}" +
        " and app_name = #{appName}" +
        " and point = #{point}" +
        " and sds_scheme_name = #{sdsSchemeName}" +
        " </script>")
int updatePointStrategy(PointStrategyDO strategyDO);
 
Example #2
Source File: DeviceMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("INSERT INTO deviceStatuses (deviceId, configFilesStatus, applicationsStatus) " +
        "VALUES (#{deviceId}, #{filesStatus}, #{appsStatus})" +
        "ON CONFLICT ON CONSTRAINT deviceStatuses_pr_key DO " +
        "UPDATE SET configFilesStatus = EXCLUDED.configFilesStatus, applicationsStatus = EXCLUDED.applicationsStatus")
int updateDeviceStatuses(@Param("deviceId") Integer deviceId,
                         @Param("filesStatus") DeviceConfigFilesStatus deviceConfigFilesStatus,
                         @Param("appsStatus") DeviceApplicationsStatus deviceApplicatiosStatus);
 
Example #3
Source File: ConfigurationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update({"UPDATE configurations SET " +
        "name=#{name}, " +
        "description=#{description}, " +
        "password=#{password}, " +
        "backgroundColor=#{backgroundColor}, " +
        "textColor=#{textColor}, " +
        "backgroundImageUrl=#{backgroundImageUrl}, " +
        "iconSize=#{iconSize}, " +
        "desktopHeader=#{desktopHeader}, " +
        "requestUpdates=#{requestUpdates}, " +
        "pushOptions=#{pushOptions}, " +
        "autoBrightness=#{autoBrightness}, " +
        "brightness=#{brightness}, " +
        "manageTimeout=#{manageTimeout}, " +
        "timeout=#{timeout}, " +
        "lockVolume=#{lockVolume}, " +
        "passwordMode=#{passwordMode}, " +
        "useDefaultDesignSettings=#{useDefaultDesignSettings}, " +
        "gps=#{gps}, " +
        "bluetooth=#{bluetooth}, " +
        "wifi=#{wifi}, " +
        "mobileData=#{mobileData}, " +
        "usbStorage=#{usbStorage}, " +
        "mainAppId=#{mainAppId}, " +
        "contentAppId=#{contentAppId}, " +
        "eventReceivingComponent=#{eventReceivingComponent}, " +
        "kioskMode=#{kioskMode}, " +
        "wifiSSID=#{wifiSSID}, " +
        "wifiPassword=#{wifiPassword}, " +
        "wifiSecurityType=#{wifiSecurityType}, " +
        "autoUpdate=#{autoUpdate}, " +
        "blockStatusBar=#{blockStatusBar}, " +
        "systemUpdateType=#{systemUpdateType}, " +
        "systemUpdateFrom=#{systemUpdateFrom}, " +
        "systemUpdateTo=#{systemUpdateTo} " +
        "WHERE id=#{id}"})
void updateConfiguration(Configuration configuration);
 
Example #4
Source File: PostgresDeviceLogMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE plugin_devicelog_settings_rules SET " +
        " settingId = #{settingId}, " +
        " name = #{name}, " +
        " active = #{active}, " +
        " applicationId = #{applicationId}, " +
        " severity = #{severity}, " +
        " filter = #{filter}, " +
        " groupId = #{groupId}, " +
        " configurationId = #{configurationId} " +
        "WHERE id = #{id}")
void updatePluginSettingsRule(PostgresDeviceLogRule rule);
 
Example #5
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurationApplications " +
        "SET applicationId=#{newAppId}, applicationVersionId=#{newAppVerId} " +
        "WHERE applicationId=#{appId} AND applicationVersionId=#{appVerId}")
void changeConfigurationsApplication(@Param("appId") Integer oldAppId,
                                     @Param("appVerId") Integer oldAppVerId,
                                     @Param("newAppId") Integer newAppId,
                                     @Param("newAppVerId") Integer newAppVerId);
 
Example #6
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE applications " +
        "SET latestVersion = (" +
        "            SELECT id " +
        "            FROM applicationVersions apv1 " +
        "            WHERE apv1.applicationId = applications.id " +
        "            AND mdm_app_version_comparison_index(apv1.version) = " +
        "                (SELECT MAX(mdm_app_version_comparison_index(apv2.version)) " +
        "                 FROM applicationVersions apv2 " +
        "                 WHERE apv2.applicationId = applications.id) " +
        "            LIMIT 1) " +
        "WHERE id = #{id}")
void recalculateLatestVersion(@Param("id") Integer applicationId);
 
Example #7
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurationApplications " +
        "SET applicationVersionId = #{newId} " +
        "WHERE applicationId = #{appId} " +
        "AND action <> 2 " +
        "AND EXISTS (SELECT 1 " +
        "            FROM configurations " +
        "            WHERE configurations.id = configurationApplications.configurationId " +
        "            AND configurations.autoUpdate IS TRUE)")
int autoUpdateConfigurationsApplication(@Param("appId") Integer applicationId,
                                        @Param("newId") Integer newAppVersionId);
 
Example #8
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET mainAppId = #{newId} " +
        "WHERE configurations.autoUpdate IS TRUE " +
        "AND EXISTS (SELECT 1 FROM applicationVersions " +
        "            WHERE applicationVersions.id = configurations.mainAppId" +
        "            AND applicationVersions.applicationId = #{appId})")
int autoUpdateConfigurationsMainApplication(@Param("appId") Integer applicationId,
                                            @Param("newId") Integer newAppVersionId);
 
Example #9
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET mainAppId = (" +
        "                 SELECT ca.applicationVersionId " +
        "                 FROM configurationApplications ca " +
        "                 INNER JOIN applications apps ON apps.id = ca.applicationId " +
        "                 WHERE ca.configurationId = configurations.id " +
        "                 AND ca.action = 1 " +
        "                 AND apps.pkg = (SELECT apps2.pkg " +
        "                                 FROM applicationVersions av " +
        "                                 INNER JOIN applications apps2 ON apps2.id = av.applicationId " +
        "                                 WHERE av.id = configurations.mainAppId)" +
        ") " +
        "WHERE configurations.customerId = #{customerId} " +
        "AND NOT configurations.mainAppId IS NULL")
int recheckConfigurationMainApplications(@Param("customerId") Integer customerId);
 
Example #10
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET mainAppId = (" +
        "                 SELECT ca.applicationVersionId " +
        "                 FROM configurationApplications ca " +
        "                 INNER JOIN applications apps ON apps.id = ca.applicationId " +
        "                 WHERE ca.configurationId = configurations.id " +
        "                 AND ca.action = 1 " +
        "                 AND apps.pkg = (SELECT apps2.pkg " +
        "                                 FROM applicationVersions av " +
        "                                 INNER JOIN applications apps2 ON apps2.id = av.applicationId " +
        "                                 WHERE av.id = configurations.mainAppId)" +
        ") " +
        "WHERE configurations.id = #{configurationId} " +
        "AND NOT configurations.mainAppId IS NULL")
int recheckConfigurationMainApplication(@Param("configurationId") Integer configurationId);
 
Example #11
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET contentAppId = (" +
        "                 SELECT ca.applicationVersionId " +
        "                 FROM configurationApplications ca " +
        "                 INNER JOIN applications apps ON apps.id = ca.applicationId " +
        "                 WHERE ca.configurationId = configurations.id " +
        "                 AND ca.action = 1 " +
        "                 AND apps.pkg = (SELECT apps2.pkg " +
        "                                 FROM applicationVersions av " +
        "                                 INNER JOIN applications apps2 ON apps2.id = av.applicationId " +
        "                                 WHERE av.id = configurations.contentAppId)" +
        ") " +
        "WHERE configurations.customerId = #{customerId} " +
        "AND NOT configurations.contentAppId IS NULL")
int recheckConfigurationContentApplications(@Param("customerId") Integer customerId);
 
Example #12
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET contentAppId = (" +
        "                 SELECT ca.applicationVersionId " +
        "                 FROM configurationApplications ca " +
        "                 INNER JOIN applications apps ON apps.id = ca.applicationId " +
        "                 WHERE ca.configurationId = configurations.id " +
        "                 AND ca.action = 1 " +
        "                 AND apps.pkg = (SELECT apps2.pkg " +
        "                                 FROM applicationVersions av " +
        "                                 INNER JOIN applications apps2 ON apps2.id = av.applicationId " +
        "                                 WHERE av.id = configurations.contentAppId)" +
        ") " +
        "WHERE configurations.id = #{configurationId} " +
        "AND NOT configurations.contentAppId IS NULL")
int recheckConfigurationContentApplication(@Param("configurationId") Integer configurationId);
 
Example #13
Source File: ApplicationMapper.java    From hmdm-server with Apache License 2.0 5 votes vote down vote up
@Update("UPDATE configurations " +
        "SET contentAppId = #{newId} " +
        "WHERE configurations.autoUpdate IS TRUE " +
        "AND EXISTS (SELECT 1 FROM applicationVersions " +
        "            WHERE applicationVersions.id = configurations.contentAppId" +
        "            AND applicationVersions.applicationId = #{appId})")
int autoUpdateConfigurationsContentApplication(@Param("appId") Integer applicationId,
                                               @Param("newId") Integer newAppVersionId);
 
Example #14
Source File: StockMapper.java    From seconds-kill with MIT License 4 votes vote down vote up
/**
 * 乐观锁 version
 */
@Update("UPDATE stock SET count = count - 1, sale = sale + 1, version = version + 1 WHERE " +
        "id = #{id, jdbcType = INTEGER} AND version = #{version, jdbcType = INTEGER}")
int updateByOptimistic(Stock stock);
 
Example #15
Source File: StockMapper.java    From seconds-kill with MIT License 4 votes vote down vote up
@Update("UPDATE stock SET count = #{count, jdbcType = INTEGER}, name = #{name, jdbcType = VARCHAR}, " +
        "sale = #{sale,jdbcType = INTEGER},version = #{version,jdbcType = INTEGER} " +
        "WHERE id = #{id, jdbcType = INTEGER}")
int updateByPrimaryKeySelective(Stock stock);
 
Example #16
Source File: UserMapper.java    From software-demo with MIT License 4 votes vote down vote up
/**
 * 更新用户
 */
@Update("update user set password = #{password}, userName = #{userName}, age = #{age}, userGender = #{userGender}, birthday = #{birthday}, identityNum = #{identityNum}, "
		+ "birthPlace = #{birthPlace}, address = #{address}, phone = #{phone}, permission = #{permission}, authority = #{authority} where id = #{id} and userId = #{userId}")
public int updateUser(User user);
 
Example #17
Source File: PostgresDeviceLogMapper.java    From hmdm-server with Apache License 2.0 4 votes vote down vote up
@Update("UPDATE plugin_devicelog_settings SET logsPreservePeriod = #{logsPreservePeriod} WHERE id = #{id}")
void updatePluginSettings(PostgresDeviceLogPluginSettings postgresDeviceLogPluginSettings);
 
Example #18
Source File: UserMapper.java    From Spring-Boot-Book with Apache License 2.0 4 votes vote down vote up
@Update("update user set name=#{name},age=#{age}  where id=#{id}")
  //void updataById(@Param("id")String id,@Param("name")String name);
//  void updataById(@Param("id")String id,@Param("name")String name);
int updateById(User user);
 
Example #19
Source File: MerchantDao.java    From txle with Apache License 2.0 4 votes vote down vote up
@Update("UPDATE txle_sample_merchant T SET T.balance = T.balance + #{balance} WHERE id = #{merchantid}")
int updateBalanceById(@Param("merchantid") long merchantid, @Param("balance") double balance);
 
Example #20
Source File: UserMapper.java    From software-demo with MIT License 4 votes vote down vote up
/**
 * 删除用户
 */
//@Delete("delete from user where id = #{id} or userid = #{userId}")
@Update("update user set isDelete = 1 where id = #{id} or userid = #{userId}")
public int deleteUserById(@Param("id") String id, @Param("userId") String userId);
 
Example #21
Source File: UserMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update( "update yx_user set now_money = now_money + ${money} where uid = #{id}")
void updateMoney(@Param("money") double money, @Param("id")int id);
 
Example #22
Source File: UserMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update("update yx_user set brokerage_price = brokerage_price+ ${price} where uid = #{id}")
void incBrokeragePrice(@Param("price")double price,@Param("id") int id);
 
Example #23
Source File: StoreProductMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update("update yx_store_product set is_del = #{status} where id = #{id}")
void updateDel(@Param("status")int status,@Param("id") Integer id);
 
Example #24
Source File: StoreProductMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update("update yx_store_product set is_show = #{status} where id = #{id}")
void updateOnsale(@Param("status")int status, @Param("id")Integer id);
 
Example #25
Source File: DeviceMapper.java    From hmdm-server with Apache License 2.0 4 votes vote down vote up
@Update({"UPDATE devices SET description = #{description} WHERE id = #{deviceId}"})
void updateDeviceDescription(@Param("deviceId") Integer deviceId,
                             @Param("description") String newDeviceDesc);
 
Example #26
Source File: QiniuConfigMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update("update qiniu_config set type = #{type} ")
void updateType(@Param("type") String type);
 
Example #27
Source File: DeviceMapper.java    From hmdm-server with Apache License 2.0 4 votes vote down vote up
@Update({"UPDATE devices SET configurationId = #{configurationId} WHERE id = #{deviceId}"})
void updateDeviceConfiguration(@Param("deviceId") Integer deviceId,
                               @Param("configurationId") Integer configurationId);
 
Example #28
Source File: DeviceMapper.java    From hmdm-server with Apache License 2.0 4 votes vote down vote up
@Update({"UPDATE devices SET " +
        "  info = #{info}, " +
        "  lastUpdate = CAST(EXTRACT(EPOCH FROM NOW()) * 1000 AS BIGINT) " +
        "WHERE id = #{deviceId}"})
void updateDeviceInfo(@Param("deviceId") Integer deviceId,
                      @Param("info") String info);
 
Example #29
Source File: UserMapper.java    From hmdm-server with Apache License 2.0 4 votes vote down vote up
@Update({"UPDATE users SET password=#{newPassword} WHERE id=#{id}"})
void updatePassword(User user);
 
Example #30
Source File: UserMapper.java    From yshopmall with Apache License 2.0 4 votes vote down vote up
@Update( "update yx_user set status = #{status} where uid = #{id}")
void updateOnstatus(@Param("status") int status, @Param("id") int id);