把内联sql改外层
This commit is contained in:
@@ -11,14 +11,7 @@ import com.nbport.zgwl.contractlaunch.dto.ContractLaunchPartyDto;
|
||||
import com.nbport.zgwl.contractlaunch.dto.ContractLaunchPlanDto;
|
||||
import com.nbport.zgwl.contractlaunch.dto.ContractLaunchQueryDto;
|
||||
import com.nbport.zgwl.contractlaunch.dto.ContractLaunchSealPositionDto;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
import org.apache.ibatis.annotations.ResultMap;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,7 +31,6 @@ public interface ContractLaunchMapper {
|
||||
|
||||
Long selectArchiveEleSeqNextVal();
|
||||
|
||||
@Select("select SEQ_SEAL_CONTRACT_LAUNCH_SEAL_POS.NEXTVAL from dual")
|
||||
Long selectSealPositionSeqNextVal();
|
||||
|
||||
IPage<ContractLaunchDto> selectContractPage(Page<ContractLaunchDto> page, @Param("query") ContractLaunchQueryDto queryDto);
|
||||
@@ -102,110 +94,17 @@ public interface ContractLaunchMapper {
|
||||
int deleteArchiveEleByContractId(@Param("contractId") Long contractId,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
@Delete("""
|
||||
delete from SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
where CONTRACT_ID = #{contractId}
|
||||
""")
|
||||
int deleteSealPositionByContractId(@Param("contractId") Long contractId,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
@Insert("""
|
||||
<script>
|
||||
INSERT ALL
|
||||
<foreach collection='list' item='item'>
|
||||
INTO SEAL_CONTRACT_LAUNCH_SEAL_POS (
|
||||
ID, CONTRACT_ID, PARTY_ID, LABEL, REQUIRED, PAGE_NUM, X, Y, WIDTH, HEIGHT,
|
||||
SEAL_ID, SEAL_NAME, REQUEST_ID, SIGNED_STATUS, SIGNED_BY_NAME, SIGNED_BY_ID, SIGNED_TIME,
|
||||
CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETED, REMARK
|
||||
) VALUES (
|
||||
SEQ_SEAL_CONTRACT_LAUNCH_SEAL_POS.NEXTVAL, #{item.contractId}, #{item.partyId}, #{item.label}, #{item.required}, #{item.pageNum}, #{item.x}, #{item.y}, #{item.width}, #{item.height},
|
||||
#{item.sealId}, #{item.sealName}, #{item.requestId}, #{item.signedStatus}, #{item.signedByName}, #{item.signedById}, #{item.signedTime},
|
||||
#{createBy}, SYSDATE, #{updateBy}, SYSDATE, 'N', #{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</script>
|
||||
""")
|
||||
int batchInsertSealPosition(@Param("list") List<ContractLaunchSealPositionDto> list,
|
||||
@Param("createBy") String createBy,
|
||||
@Param("updateBy") String updateBy);
|
||||
|
||||
@Select("""
|
||||
select ID, CONTRACT_ID, PARTY_ID, LABEL, REQUIRED, PAGE_NUM, X, Y, WIDTH, HEIGHT,
|
||||
SEAL_ID, SEAL_NAME, REQUEST_ID, SIGNED_STATUS, SIGNED_BY_NAME, SIGNED_BY_ID, SIGNED_TIME,
|
||||
CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETED, REMARK
|
||||
from SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
where CONTRACT_ID = #{contractId}
|
||||
and IS_DELETED = 'N'
|
||||
order by PAGE_NUM asc, ID asc
|
||||
""")
|
||||
@Results(id = "sealPositionResult", value = {
|
||||
@Result(property = "id", column = "ID", id = true),
|
||||
@Result(property = "contractId", column = "CONTRACT_ID"),
|
||||
@Result(property = "partyId", column = "PARTY_ID"),
|
||||
@Result(property = "label", column = "LABEL"),
|
||||
@Result(property = "required", column = "REQUIRED"),
|
||||
@Result(property = "pageNum", column = "PAGE_NUM"),
|
||||
@Result(property = "x", column = "X"),
|
||||
@Result(property = "y", column = "Y"),
|
||||
@Result(property = "width", column = "WIDTH"),
|
||||
@Result(property = "height", column = "HEIGHT"),
|
||||
@Result(property = "sealId", column = "SEAL_ID"),
|
||||
@Result(property = "sealName", column = "SEAL_NAME"),
|
||||
@Result(property = "requestId", column = "REQUEST_ID"),
|
||||
@Result(property = "signedStatus", column = "SIGNED_STATUS"),
|
||||
@Result(property = "signedByName", column = "SIGNED_BY_NAME"),
|
||||
@Result(property = "signedById", column = "SIGNED_BY_ID"),
|
||||
@Result(property = "signedTime", column = "SIGNED_TIME"),
|
||||
@Result(property = "createBy", column = "CREATE_BY"),
|
||||
@Result(property = "createTime", column = "CREATE_TIME"),
|
||||
@Result(property = "updateBy", column = "UPDATE_BY"),
|
||||
@Result(property = "updateTime", column = "UPDATE_TIME"),
|
||||
@Result(property = "isDeleted", column = "IS_DELETED"),
|
||||
@Result(property = "remark", column = "REMARK")
|
||||
})
|
||||
List<ContractLaunchSealPositionDto> selectSealPositionByContractId(@Param("contractId") Long contractId);
|
||||
|
||||
@Select("""
|
||||
select ID, CONTRACT_ID, PARTY_ID, LABEL, REQUIRED, PAGE_NUM, X, Y, WIDTH, HEIGHT,
|
||||
SEAL_ID, SEAL_NAME, REQUEST_ID, SIGNED_STATUS, SIGNED_BY_NAME, SIGNED_BY_ID, SIGNED_TIME,
|
||||
CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETED, REMARK
|
||||
from SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
where REQUEST_ID = #{requestId}
|
||||
and IS_DELETED = 'N'
|
||||
order by ID asc
|
||||
""")
|
||||
@ResultMap("sealPositionResult")
|
||||
List<ContractLaunchSealPositionDto> selectSealPositionByRequestId(@Param("requestId") String requestId);
|
||||
|
||||
@Update("""
|
||||
<script>
|
||||
update SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
<trim prefix='set' suffixOverrides=','>
|
||||
PARTY_ID = #{partyId},
|
||||
LABEL = #{label},
|
||||
REQUIRED = #{required},
|
||||
PAGE_NUM = #{pageNum},
|
||||
X = #{x},
|
||||
Y = #{y},
|
||||
WIDTH = #{width},
|
||||
HEIGHT = #{height},
|
||||
SEAL_ID = #{sealId},
|
||||
SEAL_NAME = #{sealName},
|
||||
REQUEST_ID = #{requestId},
|
||||
SIGNED_STATUS = #{signedStatus},
|
||||
SIGNED_BY_NAME = #{signedByName},
|
||||
SIGNED_BY_ID = #{signedById},
|
||||
SIGNED_TIME = #{signedTime},
|
||||
UPDATE_BY = #{updateBy},
|
||||
UPDATE_TIME = #{updateTime},
|
||||
IS_DELETED = #{isDeleted},
|
||||
REMARK = #{remark},
|
||||
</trim>
|
||||
where ID = #{id}
|
||||
and IS_DELETED = 'N'
|
||||
</script>
|
||||
""")
|
||||
int updateSealPosition(ContractLaunchSealPositionDto position);
|
||||
|
||||
List<ContractLaunchPartyDto> selectPartyByContractIds(@Param("contractIds") List<Long> contractIds);
|
||||
|
||||
@@ -197,6 +197,39 @@
|
||||
<result property="remark" column="REMARK"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SealPositionResult" type="com.nbport.zgwl.contractlaunch.dto.ContractLaunchSealPositionDto">
|
||||
<id property="id" column="ID"/>
|
||||
<result property="contractId" column="CONTRACT_ID"/>
|
||||
<result property="partyId" column="PARTY_ID"/>
|
||||
<result property="label" column="LABEL"/>
|
||||
<result property="required" column="REQUIRED"/>
|
||||
<result property="pageNum" column="PAGE_NUM"/>
|
||||
<result property="x" column="X"/>
|
||||
<result property="y" column="Y"/>
|
||||
<result property="width" column="WIDTH"/>
|
||||
<result property="height" column="HEIGHT"/>
|
||||
<result property="sealId" column="SEAL_ID"/>
|
||||
<result property="sealName" column="SEAL_NAME"/>
|
||||
<result property="requestId" column="REQUEST_ID"/>
|
||||
<result property="signedStatus" column="SIGNED_STATUS"/>
|
||||
<result property="signedByName" column="SIGNED_BY_NAME"/>
|
||||
<result property="signedById" column="SIGNED_BY_ID"/>
|
||||
<result property="signedTime" column="SIGNED_TIME"/>
|
||||
<result property="createBy" column="CREATE_BY"/>
|
||||
<result property="createTime" column="CREATE_TIME"/>
|
||||
<result property="updateBy" column="UPDATE_BY"/>
|
||||
<result property="updateTime" column="UPDATE_TIME"/>
|
||||
<result property="isDeleted" column="IS_DELETED"/>
|
||||
<result property="remark" column="REMARK"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="sealPositionColumns">
|
||||
select ID, CONTRACT_ID, PARTY_ID, LABEL, REQUIRED, PAGE_NUM, X, Y, WIDTH, HEIGHT,
|
||||
SEAL_ID, SEAL_NAME, REQUEST_ID, SIGNED_STATUS, SIGNED_BY_NAME, SIGNED_BY_ID, SIGNED_TIME,
|
||||
CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETED, REMARK
|
||||
from SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
</sql>
|
||||
|
||||
<sql id="mainColumns">
|
||||
select ID, CONTRACT_SYS_ID, CONTRACT_CODE, LAW_CONTRACT_CODE, LAW_CONTRACT_ID,
|
||||
CONTRACT_NAME, CONTRACT_TYPE, CONTRACT_TYPE_CODE, CONTRACT_SOURCE, CREATION_MODE,
|
||||
@@ -241,6 +274,9 @@
|
||||
<select id="selectArchiveEleSeqNextVal" resultType="java.lang.Long" useCache="false" flushCache="true">
|
||||
select SEQ_SC_AR_ELE.NEXTVAL from dual
|
||||
</select>
|
||||
<select id="selectSealPositionSeqNextVal" resultType="java.lang.Long" useCache="false" flushCache="true">
|
||||
select SEQ_SEAL_CONTRACT_LAUNCH_SEAL_POS.NEXTVAL from dual
|
||||
</select>
|
||||
|
||||
<!--
|
||||
权限过滤说明(对应需求文档"使用角色与权限"章节):
|
||||
@@ -608,6 +644,27 @@
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
<delete id="deleteSealPositionByContractId">
|
||||
delete from SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
where CONTRACT_ID = #{contractId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertSealPosition">
|
||||
INSERT ALL
|
||||
<foreach collection="list" item="item">
|
||||
INTO SEAL_CONTRACT_LAUNCH_SEAL_POS (
|
||||
ID, CONTRACT_ID, PARTY_ID, LABEL, REQUIRED, PAGE_NUM, X, Y, WIDTH, HEIGHT,
|
||||
SEAL_ID, SEAL_NAME, REQUEST_ID, SIGNED_STATUS, SIGNED_BY_NAME, SIGNED_BY_ID, SIGNED_TIME,
|
||||
CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETED, REMARK
|
||||
) VALUES (
|
||||
SEQ_SEAL_CONTRACT_LAUNCH_SEAL_POS.NEXTVAL, #{item.contractId}, #{item.partyId}, #{item.label}, #{item.required}, #{item.pageNum}, #{item.x}, #{item.y}, #{item.width}, #{item.height},
|
||||
#{item.sealId}, #{item.sealName}, #{item.requestId}, #{item.signedStatus}, #{item.signedByName}, #{item.signedById}, #{item.signedTime},
|
||||
#{createBy}, SYSDATE, #{updateBy}, SYSDATE, 'N', #{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
SELECT 1 FROM DUAL
|
||||
</insert>
|
||||
|
||||
<insert id="insertLog" parameterType="com.nbport.zgwl.contractlaunch.dto.ContractLaunchLogDto">
|
||||
insert into SEAL_CONTRACT_LAUNCH_LOG (
|
||||
ID, CONTRACT_ID, ACTION_TYPE, ACTION_NAME, ACTION_STATUS, OPERATOR_NAME, OPERATOR_PHONE,
|
||||
@@ -682,6 +739,47 @@
|
||||
and IS_DELETED = 'N'
|
||||
</update>
|
||||
|
||||
<select id="selectSealPositionByContractId" resultMap="SealPositionResult">
|
||||
<include refid="sealPositionColumns"/>
|
||||
where CONTRACT_ID = #{contractId}
|
||||
and IS_DELETED = 'N'
|
||||
order by PAGE_NUM asc, ID asc
|
||||
</select>
|
||||
|
||||
<select id="selectSealPositionByRequestId" resultMap="SealPositionResult">
|
||||
<include refid="sealPositionColumns"/>
|
||||
where REQUEST_ID = #{requestId}
|
||||
and IS_DELETED = 'N'
|
||||
order by ID asc
|
||||
</select>
|
||||
|
||||
<update id="updateSealPosition" parameterType="com.nbport.zgwl.contractlaunch.dto.ContractLaunchSealPositionDto">
|
||||
update SEAL_CONTRACT_LAUNCH_SEAL_POS
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
PARTY_ID = #{partyId},
|
||||
LABEL = #{label},
|
||||
REQUIRED = #{required},
|
||||
PAGE_NUM = #{pageNum},
|
||||
X = #{x},
|
||||
Y = #{y},
|
||||
WIDTH = #{width},
|
||||
HEIGHT = #{height},
|
||||
SEAL_ID = #{sealId},
|
||||
SEAL_NAME = #{sealName},
|
||||
REQUEST_ID = #{requestId},
|
||||
SIGNED_STATUS = #{signedStatus},
|
||||
SIGNED_BY_NAME = #{signedByName},
|
||||
SIGNED_BY_ID = #{signedById},
|
||||
SIGNED_TIME = #{signedTime},
|
||||
UPDATE_BY = #{updateBy},
|
||||
UPDATE_TIME = #{updateTime},
|
||||
IS_DELETED = #{isDeleted},
|
||||
REMARK = #{remark},
|
||||
</trim>
|
||||
where ID = #{id}
|
||||
and IS_DELETED = 'N'
|
||||
</update>
|
||||
|
||||
<select id="selectPartyByContractIds" resultMap="PartyResult">
|
||||
select ID, CONTRACT_ID, ROLE_CODE, ROLE_NAME, SUBJECT_CODE, SORT_ORDER, PARTNER_ID, OPPOSITE_ID,
|
||||
COMPANY_NAME, COMPANY_TYPE, OPPOSITE_CHARACTER, CONTACT_NAME, CONTACT_PHONE,
|
||||
|
||||
Reference in New Issue
Block a user