<commit_before>/*
 * Copyright  2013 VillageReach.  All Rights Reserved.  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.openlmis.core.repository.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.openlmis.core.domain.FacilityFtpDetails;
import org.springframework.stereotype.Repository;

@Repository
public interface FacilityFtpDetailsMapper {

  @Insert({"INSERT INTO facility_ftp_details (facilityCode, serverHost, serverPort, userName, password, localFolderPath, createdBy, modifiedBy) ",
    "VALUES (#{facilityCode}, #{serverHost}, #{serverPort}, #{userName}, #{password}, #{localFolderPath}, #{createdBy}, #{modifiedBy})"})
  @Options(useGeneratedKeys = true)
  public void insert(FacilityFtpDetails facilityFtpDetails);

  @Select({"SELECT * FROM facility_ftp_details WHERE facilityCode = #{facilityCode}"})
  FacilityFtpDetails getByFacilityCode(String facilityCode);

  @Update({"UPDATE facility_ftp_details SET serverHost = #{serverHost}, serverPort = #{serverPort}, userName = #{userName}, ",
    "password = #{password}, localFolderPath = #{localFolderPath}, ",
    "modifiedBy = #{modifiedBy} WHERE id = #{id}"})
  void update(FacilityFtpDetails facilityFtpDetails);

}<commit_msg>|#980|+Riya| Update 'modifiedDate' on update on facility FTP details.<commit_after>/*
 * Copyright  2013 VillageReach.  All Rights Reserved.  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 *
 * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.openlmis.core.repository.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.openlmis.core.domain.FacilityFtpDetails;
import org.springframework.stereotype.Repository;

@Repository
public interface FacilityFtpDetailsMapper {

  @Insert({"INSERT INTO facility_ftp_details (facilityCode, serverHost, serverPort, userName, password, localFolderPath, createdBy, modifiedBy) ",
    "VALUES (#{facilityCode}, #{serverHost}, #{serverPort}, #{userName}, #{password}, #{localFolderPath}, #{createdBy}, #{modifiedBy})"})
  @Options(useGeneratedKeys = true)
  public void insert(FacilityFtpDetails facilityFtpDetails);

  @Select({"SELECT * FROM facility_ftp_details WHERE facilityCode = #{facilityCode}"})
  FacilityFtpDetails getByFacilityCode(String facilityCode);

  @Update({"UPDATE facility_ftp_details SET serverHost = #{serverHost}, serverPort = #{serverPort}, userName = #{userName}, ",
    "password = <PASSWORD>}, localFolderPath = #{localFolderPath}, ",
    "modifiedBy = #{modifiedBy}, modifiedDate = (COALESCE(#{modifiedDate}, NOW())) WHERE id = #{id}"})
  void update(FacilityFtpDetails facilityFtpDetails);

}
{'fraction_non_alphanumeric': 0.12511969358442387, 'fraction_numerical': 0.006064474944142994, 'mean_word_length': 6.090497737556561, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3441482', 'n_tokens_mistral': 931, 'n_tokens_neox': 901, 'n_words': 241}