123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <?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.ruoyi.shipping.mapper.TVoyageMapper">
- <resultMap type="TVoyage" id="TVoyageResult">
- <result property="fId" column="f_id" />
- <result property="fPid" column="f_pid" />
- <result property="fNo" column="f_no" />
- <result property="fPortofloadid" column="f_portofloadid" />
- <result property="fPortofdischargeid" column="f_portofdischargeid" />
- <result property="fDistinationid" column="f_distinationid" />
- <result property="fPortoftransshipment" column="f_portoftransshipment" />
- <result property="fEtd" column="f_ETD" />
- <result property="fAtd" column="f_ATD" />
- <result property="fEta" column="f_ETA" />
- <result property="fAta" column="f_ATA" />
- <result property="fDays" column="f_days" />
- <result property="fDucomentrayoffdate" column="f_ducomentrayoffdate" />
- <result property="fCutoffdate" column="f_cutoffdate" />
- <result property="fTeu" column="f_teu" />
- <result property="fManageid" column="f_manageid" />
- <result property="fTel" column="f_tel" />
- <result property="fStatus" column="f_status" />
- <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="remark" column="remark" />
- </resultMap>
- <sql id="selectTVoyageVo">
- select f_id, f_pid, f_no, f_portofloadid, f_portofdischargeid, f_distinationid, f_portoftransshipment, f_ETD, f_ATD, f_ETA, f_ATA, f_days, f_ducomentrayoffdate, f_cutoffdate, f_teu, f_manageid, f_tel, case when f_status = 'T' then '正常' else '停用' end as f_status, create_by, create_time, update_by, update_time, remark from t_voyage
- </sql>
- <select id="selectTVoyageList" parameterType="TVoyage" resultMap="TVoyageResult">
- SELECT
- tv.f_id,
- tv.f_pid,
- te.f_name pidName,
- tv.f_no,
- tv.f_portofloadid,
- ta.f_name portofloadidName,
- tv.f_portofdischargeid,
- td.f_name portofdischargeidName,
- tv.f_distinationid,
- tr.f_name distinationidName,
- tv.f_portoftransshipment,
- ts.f_name portoftransshipmentName,
- tv.f_ETD,
- tv.f_ATD,
- tv.f_ETA,
- tv.f_ATA,
- tv.f_days,
- tv.f_ducomentrayoffdate,
- tv.f_cutoffdate,
- tv.f_teu,
- tv.f_manageid,
- su.user_name manageidName,
- tv.f_tel,
- CASE
- WHEN tv.f_status = 'T' THEN
- '正常' ELSE '停用'
- END AS f_status,
- TIMESTAMPDIFF(DAY,tv.f_ETD,DATE_FORMAT(tv.f_ducomentrayoffdate, '%Y-%m-%d %H:%i:%S')) closing,
- tv.create_by,
- tv.create_time,
- tv.update_by,
- tv.update_time,
- tv.remark
- FROM
- t_voyage tv
- LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
- LEFT JOIN t_address ta ON tv.f_portofloadid = ta.f_id
- LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
- LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
- LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
- LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
- <where>
- tv.f_status = 'T'
- <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
- <if test="fNo != null and fNo != ''"> and tv.f_no = #{fNo}</if>
- <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
- <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
- <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
- <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
- <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
- <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
- <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
- <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
- <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
- <if test="fDays != null "> and tv.f_days = #{fDays}</if>
- <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
- <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
- <if test="fTeu != null and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
- <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
- <if test="fTel != null and fTel != ''"> and tv.f_tel = #{fTel}</if>
- <if test="fStatus != null and fStatus != ''"> and tv.f_status = #{fStatus}</if>
- <if test="createBy != null and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
- <if test="remark != null and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
- <if test="pidName != null and pidName != ''"> and te.f_name = #{pidName}</if>
- <if test="portofloadidName != null and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
- <if test="portofdischargeidName != null and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
- <if test="distinationidName != null and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
- <if test="portoftransshipmentName != null and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tv.create_time >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tv.create_time <= #{cLoadDate[1]}
- </if>
- </where>
- </select>
- <select id="selectTVoyageById" parameterType="Long" resultMap="TVoyageResult">
- SELECT
- tv.f_id,
- tv.f_pid,
- te.f_name pidName,
- tv.f_no,
- tv.f_portofloadid,
- ta.f_name portofloadidName,
- tv.f_portofdischargeid,
- td.f_name portofdischargeidName,
- tv.f_distinationid,
- tr.f_name distinationidName,
- tv.f_portoftransshipment,
- ts.f_name portoftransshipmentName,
- tv.f_ETD,
- tv.f_ATD,
- tv.f_ETA,
- tv.f_ATA,
- tv.f_days,
- tv.f_ducomentrayoffdate,
- tv.f_cutoffdate,
- tv.f_teu,
- tv.f_manageid,
- su.user_name manageidName,
- tv.f_tel,
- CASE
- WHEN tv.f_status = 'T' THEN
- '正常' ELSE '停用'
- END AS f_status,
- TIMESTAMPDIFF(
- DAY,
- tv.f_ETD,
- DATE_FORMAT( tv.f_cutoffdate, '%Y-%m-%d %H:%i:%S' )) closing,
- tv.create_by,
- tv.create_time,
- tv.update_by,
- tv.update_time,
- tv.remark
- FROM
- t_voyage tv
- LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
- LEFT JOIN t_address ta ON tv.f_portofloadid = ta.f_id
- LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
- LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
- LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
- LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
- WHERE
- tv.f_id = #{fId}
- </select>
- <insert id="insertTVoyage" parameterType="TVoyage" useGeneratedKeys="true" keyProperty="fId">
- insert into t_voyage
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fPid != null">f_pid,</if>
- <if test="fNo != null and fNo != ''">f_no,</if>
- <if test="fPortofloadid != null">f_portofloadid,</if>
- <if test="fPortofdischargeid != null">f_portofdischargeid,</if>
- <if test="fDistinationid != null">f_distinationid,</if>
- <if test="fPortoftransshipment != null">f_portoftransshipment,</if>
- <if test="fEtd != null">f_ETD,</if>
- <if test="fAtd != null">f_ATD,</if>
- <if test="fEta != null">f_ETA,</if>
- <if test="fAta != null">f_ATA,</if>
- <if test="fDays != null">f_days,</if>
- <if test="fDucomentrayoffdate != null">f_ducomentrayoffdate,</if>
- <if test="fCutoffdate != null">f_cutoffdate,</if>
- <if test="fTeu != null">f_teu,</if>
- <if test="fManageid != null">f_manageid,</if>
- <if test="fTel != null and fTel != ''">f_tel,</if>
- <if test="fStatus != null">f_status,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fPid != null">#{fPid},</if>
- <if test="fNo != null and fNo != ''">#{fNo},</if>
- <if test="fPortofloadid != null">#{fPortofloadid},</if>
- <if test="fPortofdischargeid != null">#{fPortofdischargeid},</if>
- <if test="fDistinationid != null">#{fDistinationid},</if>
- <if test="fPortoftransshipment != null">#{fPortoftransshipment},</if>
- <if test="fEtd != null">#{fEtd},</if>
- <if test="fAtd != null">#{fAtd},</if>
- <if test="fEta != null">#{fEta},</if>
- <if test="fAta != null">#{fAta},</if>
- <if test="fDays != null">#{fDays},</if>
- <if test="fDucomentrayoffdate != null">#{fDucomentrayoffdate},</if>
- <if test="fCutoffdate != null">#{fCutoffdate},</if>
- <if test="fTeu != null">#{fTeu},</if>
- <if test="fManageid != null">#{fManageid},</if>
- <if test="fTel != null and fTel != ''">#{fTel},</if>
- <if test="fStatus != null">#{fStatus},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTVoyage" parameterType="TVoyage">
- update t_voyage
- <trim prefix="SET" suffixOverrides=",">
- <if test="fPid != null">f_pid = #{fPid},</if>
- <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
- <if test="fPortofloadid != null">f_portofloadid = #{fPortofloadid},</if>
- <if test="fPortofdischargeid != null">f_portofdischargeid = #{fPortofdischargeid},</if>
- <if test="fPortofdischargeid == null">f_portofdischargeid = null,</if>
- <if test="fDistinationid != null">f_distinationid = #{fDistinationid},</if>
- <if test="fPortoftransshipment != null">f_portoftransshipment = #{fPortoftransshipment},</if>
- <if test="fPortoftransshipment == null">f_portoftransshipment = null,</if>
- <if test="fEtd != null">f_ETD = #{fEtd},</if>
- <if test="fAtd != null">f_ATD = #{fAtd},</if>
- <if test="fEta != null">f_ETA = #{fEta},</if>
- <if test="fAta != null">f_ATA = #{fAta},</if>
- <if test="fDays != null">f_days = #{fDays},</if>
- <if test="fDucomentrayoffdate != null">f_ducomentrayoffdate = #{fDucomentrayoffdate},</if>
- <if test="fCutoffdate != null">f_cutoffdate = #{fCutoffdate},</if>
- <if test="fTeu != null">f_teu = #{fTeu},</if>
- <if test="fManageid != null">f_manageid = #{fManageid},</if>
- <if test="fTel != null and fTel != ''">f_tel = #{fTel},</if>
- <if test="fStatus != null">f_status = #{fStatus},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTVoyageById" parameterType="Long">
- delete from t_voyage where f_id = #{fId}
- </delete>
- <delete id="deleteTVoyageByIds" parameterType="String">
- delete from t_voyage where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <select id="selectTVoyagefNo" parameterType="TVoyage" resultMap="TVoyageResult">
- SELECT
- f_id,
- f_no
- FROM
- t_voyage
- WHERE
- f_no = #{fNo}
- </select>
- <select id="selectTVoyagefNumber" resultType="map">
- SELECT
- f_id fId,
- f_no fNo
- FROM
- t_voyage
- WHERE
- f_status = 'T'
- <if test="fNo != null and fNo != ''">
- and f_no like concat('%', #{fNo}, '%')
- </if>
- </select>
- </mapper>
|