package jnpf.elnMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import jnpf.elnEntity.runtime.ElnSharedFillOperationEntity;
|
import org.apache.ibatis.annotations.Insert;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Update;
|
|
@Mapper
|
public interface ElnSharedFillOperationMapper
|
extends BaseMapper<ElnSharedFillOperationEntity> {
|
|
@Insert("INSERT INTO eln_shared_fill_operation "
|
+ "(operation_code, request_digest, operation_status, operator_user_id, "
|
+ "f_id, f_tenant_id, f_version, f_creator_user_id, f_creator_time, "
|
+ "f_delete_mark) VALUES "
|
+ "(#{value.operationCode}, #{value.requestDigest}, 'OPEN', "
|
+ "#{value.operatorUserId}, #{value.id}, #{value.fTenantId}, 0, "
|
+ "#{value.operatorUserId}, CURRENT_TIMESTAMP, 0) "
|
+ "ON CONFLICT (f_tenant_id, operation_code) DO NOTHING")
|
int insertIgnore(@Param("value") ElnSharedFillOperationEntity value);
|
|
@Update("UPDATE eln_shared_fill_operation SET operation_status = 'COMPLETED', "
|
+ "result_json = #{resultJson}, f_version = f_version + 1, "
|
+ "f_last_modify_user_id = #{userId}, f_last_modify_time = CURRENT_TIMESTAMP "
|
+ "WHERE f_tenant_id = #{tenantId} AND operation_code = #{operationCode} "
|
+ "AND request_digest = #{requestDigest} AND operation_status = 'OPEN' "
|
+ "AND COALESCE(f_delete_mark, 0) = 0")
|
int complete(@Param("tenantId") String tenantId,
|
@Param("operationCode") String operationCode,
|
@Param("requestDigest") String requestDigest,
|
@Param("resultJson") String resultJson,
|
@Param("userId") String userId);
|
|
@Update("UPDATE eln_shared_fill_operation SET result_json = #{resultJson}, "
|
+ "f_version = f_version + 1, f_last_modify_user_id = #{userId}, "
|
+ "f_last_modify_time = CURRENT_TIMESTAMP "
|
+ "WHERE f_tenant_id = #{tenantId} AND operation_code = #{operationCode} "
|
+ "AND request_digest = #{requestDigest} AND operation_status = 'OPEN' "
|
+ "AND result_json IS NULL AND COALESCE(f_delete_mark, 0) = 0")
|
int prepareResult(@Param("tenantId") String tenantId,
|
@Param("operationCode") String operationCode,
|
@Param("requestDigest") String requestDigest,
|
@Param("resultJson") String resultJson,
|
@Param("userId") String userId);
|
|
@Update("UPDATE eln_shared_fill_operation SET operation_status = 'COMPLETED', "
|
+ "f_version = f_version + 1, f_last_modify_user_id = #{userId}, "
|
+ "f_last_modify_time = CURRENT_TIMESTAMP "
|
+ "WHERE f_tenant_id = #{tenantId} AND operation_code = #{operationCode} "
|
+ "AND operator_user_id = #{userId} AND operation_status = 'OPEN' "
|
+ "AND result_json IS NOT NULL AND COALESCE(f_delete_mark, 0) = 0")
|
int confirmPrepared(@Param("tenantId") String tenantId,
|
@Param("operationCode") String operationCode,
|
@Param("userId") String userId);
|
}
|