WholeProcessPlatform/backend/src/main/resources/mapper/data/FishDraftDataMapper.xml

222 lines
8.2 KiB
XML
Raw Normal View History

2026-04-23 10:53:10 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yfd.platform.data.mapper.FishDraftDataMapper">
<resultMap id="BaseResultMap" type="com.yfd.platform.data.domain.FishDraftData">
<id column="ID" property="id"/>
<result column="STCD" property="stcd"/>
2026-04-27 15:55:24 +08:00
<result column="WT" property="wt"/>
2026-04-23 10:53:10 +08:00
<result column="TM" property="tm"/>
<result column="FTP" property="ftp"/>
<result column="FSZ" property="fsz"/>
<result column="FCNT" property="fcnt"/>
<result column="FWET" property="fwet"/>
<result column="STRDT" property="strdt"/>
<result column="ENDDT" property="enddt"/>
<result column="DIRECTION" property="direction"/>
<result column="YR" property="yr"/>
<result column="MOUTH" property="mouth"/>
<result column="VDPTH" property="vdpth"/>
<result column="PICPTH" property="picpth"/>
<result column="ISFS" property="isfs"/>
<result column="SOURCE_TYPE" property="sourceType"/>
<result column="APPROVAL_ID" property="approvalId"/>
<result column="STATUS" property="status"/>
<result column="LOCK_FLAG" property="lockFlag"/>
<result column="SUBMIT_TIME" property="submitTime"/>
<result column="APPROVE_TIME" property="approveTime"/>
<result column="DELETED_FLAG" property="deletedFlag"/>
<result column="DELETED_BY" property="deletedBy"/>
<result column="DELETED_AT" property="deletedAt"/>
<result column="CREATED_AT" property="createdAt"/>
<result column="CREATED_BY" property="createdBy"/>
<result column="UPDATED_AT" property="updatedAt"/>
<result column="UPDATED_BY" property="updatedBy"/>
</resultMap>
<resultMap id="JoinResultMap" type="com.yfd.platform.data.domain.vo.FishDraftDataVO">
<id column="ID" property="id"/>
<result column="STCD" property="stcd"/>
<result column="TM" property="tm"/>
<result column="FTP" property="ftp"/>
2026-04-24 09:26:29 +08:00
<result column="FTP" property="ftp"/>
<result column="FTPNAME" property="ftpName"/>
2026-04-23 10:53:10 +08:00
<result column="FSZ" property="fsz"/>
<result column="FCNT" property="fcnt"/>
<result column="FWET" property="fwet"/>
<result column="STRDT" property="strdt"/>
<result column="ENDDT" property="enddt"/>
<result column="DIRECTION" property="direction"/>
<result column="YR" property="yr"/>
<result column="WT" property="wt"/>
2026-04-23 10:53:10 +08:00
<result column="MOUTH" property="mouth"/>
<result column="VDPTH" property="vdpth"/>
<result column="PICPTH" property="picpth"/>
<result column="ISFS" property="isfs"/>
<result column="SOURCE_TYPE" property="sourceType"/>
<result column="APPROVAL_ID" property="approvalId"/>
<result column="STATUS" property="status"/>
<result column="LOCK_FLAG" property="lockFlag"/>
<result column="SUBMIT_TIME" property="submitTime"/>
<result column="APPROVE_TIME" property="approveTime"/>
<result column="DELETED_FLAG" property="deletedFlag"/>
<result column="DELETED_BY" property="deletedBy"/>
<result column="DELETED_AT" property="deletedAt"/>
<result column="CREATED_AT" property="createdAt"/>
<result column="CREATED_BY" property="createdBy"/>
<result column="UPDATED_AT" property="updatedAt"/>
<result column="UPDATED_BY" property="updatedBy"/>
<result column="STNM" property="stnm"/>
<result column="STTP" property="sttp"/>
<result column="RSTCD" property="rstcd"/>
<result column="ENNM" property="ennm"/>
<result column="BASE_ID" property="baseId"/>
<result column="BASENAME" property="baseName"/>
2026-04-23 10:53:10 +08:00
<result column="RVCD" property="rvcd"/>
<result column="LGTD" property="lgtd"/>
<result column="LTTD" property="lttd"/>
<result column="ORDER_INDEX" property="orderIndex"/>
</resultMap>
<sql id="joinColumns">
D.ID,
D.STCD,
D.TM,
D.FTP,
2026-04-24 09:26:29 +08:00
FB.NAME FTPNAME,
2026-04-23 10:53:10 +08:00
D.FSZ,
D.FCNT,
D.FWET,
D.STRDT,
D.ENDDT,
D.DIRECTION,
D.YR,
D.WT,
2026-04-23 10:53:10 +08:00
D.MOUTH,
D.VDPTH,
D.PICPTH,
D.ISFS,
D.SOURCE_TYPE,
D.APPROVAL_ID,
D.STATUS,
D.LOCK_FLAG,
D.SUBMIT_TIME,
D.APPROVE_TIME,
D.DELETED_FLAG,
D.DELETED_BY,
D.DELETED_AT,
D.CREATED_AT,
D.CREATED_BY,
D.UPDATED_AT,
D.UPDATED_BY,
F.STNM,
F.STTP,
F.RSTCD,
E.ENNM,
E.BASE_ID,
H.BASENAME,
2026-04-23 10:53:10 +08:00
E.RVCD,
E.LGTD,
E.LTTD,
E.ORDER_INDEX
</sql>
<select id="selectJoinPage" resultMap="JoinResultMap">
SELECT
<include refid="joinColumns"/>
FROM FISH_DRAFT_DATA D
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
2026-04-24 09:26:29 +08:00
LEFT JOIN SD_FISHDICTORY_B FB ON FB.ID = D.FTP
2026-04-23 10:53:10 +08:00
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
LEFT JOIN SD_HYDROBASE H ON E.BASE_ID = H.BASEID
2026-04-23 10:53:10 +08:00
WHERE D.DELETED_FLAG = 0
<if test="stcd != null and stcd != ''">
AND D.STCD = #{stcd}
</if>
2026-04-27 18:42:51 +08:00
<if test="userId != null and userId != ''">
AND D.CREATED_BY = #{userId}
</if>
<if test="ftp != null and ftp != ''">
2026-04-23 10:53:10 +08:00
AND D.FTP = #{ftp}
</if>
<if test="rstcd != null and rstcd != ''">
AND F.RSTCD = #{rstcd}
</if>
<if test="baseId != null and baseId != ''">
AND E.BASE_ID = #{baseId}
</if>
<if test="direction != null and direction != ''">
AND D.DIRECTION = #{direction}
</if>
<if test="status != null and status != ''">
AND D.STATUS = #{status}
</if>
<if test="startTime != null and startTime != ''">
AND D.TM &gt;= TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="endTime != null and endTime != ''">
AND D.TM &lt;= TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
2026-04-23 10:53:10 +08:00
ORDER BY D.CREATED_AT DESC
</select>
<select id="selectJoinList" resultMap="JoinResultMap">
SELECT
<include refid="joinColumns"/>
FROM FISH_DRAFT_DATA D
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
WHERE D.DELETED_FLAG = 0
<if test="stcd != null and stcd != ''">
AND D.STCD = #{stcd}
</if>
<if test="ftp != null and ftp != ''">
AND D.FTP = #{ftp}
</if>
2026-04-23 10:53:10 +08:00
<if test="rstcd != null and rstcd != ''">
AND F.RSTCD = #{rstcd}
</if>
<if test="baseId != null and baseId != ''">
AND E.BASE_ID = #{baseId}
</if>
<if test="direction != null and direction != ''">
AND D.DIRECTION = #{direction}
</if>
<if test="status != null and status != ''">
AND D.STATUS = #{status}
</if>
<if test="startTime != null and startTime != ''">
AND D.TM &gt;= TO_DATE(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="endTime != null and endTime != ''">
AND D.TM &lt;= TO_DATE(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
2026-04-23 10:53:10 +08:00
ORDER BY D.CREATED_AT DESC
</select>
<select id="selectJoinCount" resultType="long">
SELECT COUNT(*)
FROM FISH_DRAFT_DATA D
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
WHERE D.DELETED_FLAG = 0
<if test="stcd != null and stcd != ''">
AND D.STCD = #{stcd}
</if>
<if test="rstcd != null and rstcd != ''">
AND F.RSTCD = #{rstcd}
</if>
<if test="baseId != null and baseId != ''">
AND E.BASE_ID = #{baseId}
</if>
<if test="direction != null and direction != ''">
AND D.DIRECTION = #{direction}
</if>
<if test="status != null and status != ''">
AND D.STATUS = #{status}
</if>
</select>
</mapper>