123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?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.TCntrMapper">
- <resultMap type="TCntr" id="TCntrResult">
- <result property="fId" column="f_id"/>
- <result property="fType" column="f_type"/>
- <result property="fNo" column="f_no"/>
- <result property="fName" column="f_name"/>
- <result property="fEname" column="f_ename"/>
- <result property="fUncode" column="f_uncode"/>
- <result property="fTeu" column="f_teu"/>
- <result property="fCbm" column="f_cbm"/>
- <result property="fWeight" column="f_weight"/>
- <result property="fCntrsize" column="f_cntrsize"/>
- <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="selectTCntrVo">
- select f_id, f_type, f_no, f_name, f_ename, f_uncode, f_teu, f_cbm, f_weight, f_cntrsize, CASE WHEN f_status = 'T' THEN '正常' ELSE '停用' END AS f_status, create_by, create_time, update_by, update_time, remark from t_cntr
- </sql>
- <select id="selectTCntrList" parameterType="TCntr" resultMap="TCntrResult">
- SELECT
- f_id,
- f_type,
- s.dict_label typeName,
- f_no,
- f_name,
- f_ename,
- f_uncode,
- f_teu,
- f_cbm,
- f_weight,
- f_cntrsize,
- CASE
- WHEN f_status = 'T' THEN
- '正常' ELSE '停用'
- END AS f_status,
- create_by,
- create_time,
- update_by,
- update_time,
- remark
- FROM
- t_cntr t
- LEFT JOIN ( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'f_type' ) s ON t.f_type =
- s.dict_value
- <where>
- t.f_status = 'T'
- <if test="fType != null ">and t.f_type = #{fType}</if>
- <if test="fNo != null and fNo != ''">and t.f_no = like concat('%', #{fNo}, '%')</if>
- <if test="fName != null and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
- <if test="fEname != null and fEname != ''">and t.f_ename like concat('%', #{fEname}, '%')</if>
- <if test="fUncode != null and fUncode != ''">and t.f_uncode = #{fUncode}</if>
- <if test="fTeu != null ">and t.f_teu = #{fTeu}</if>
- <if test="fCbm != null ">and t.f_cbm = #{fCbm}</if>
- <if test="fWeight != null ">and t.f_weight = #{fWeight}</if>
- <if test="fCntrsize != null ">and t.f_cntrsize = #{fCntrsize}</if>
- <if test="fStatus != null and fStatus != ''">and t.f_status = #{fStatus}</if>
- <if test="createBy != null and createBy != ''">and t.create_by = #{createBy}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and t.create_time >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and t.create_time <= #{cLoadDate[1]}
- </if>
- </where>
- ORDER BY CONVERT(t.f_name USING gbk) asc
- </select>
- <select id="selectTCntrById" parameterType="Long" resultMap="TCntrResult">
- <include refid="selectTCntrVo"/>
- where f_id = #{fId}
- </select>
- <insert id="insertTCntr" parameterType="TCntr">
- insert into t_cntr
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fId != null">f_id,</if>
- <if test="fType != null">f_type,</if>
- <if test="fNo != null and fNo != ''">f_no,</if>
- <if test="fName != null and fName != ''">f_name,</if>
- <if test="fEname != null and fEname != ''">f_ename,</if>
- <if test="fUncode != null">f_uncode,</if>
- <if test="fTeu != null">f_teu,</if>
- <if test="fCbm != null">f_cbm,</if>
- <if test="fWeight != null">f_weight,</if>
- <if test="fCntrsize != null">f_cntrsize,</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="fId != null">#{fId},</if>
- <if test="fType != null">#{fType},</if>
- <if test="fNo != null and fNo != ''">#{fNo},</if>
- <if test="fName != null and fName != ''">#{fName},</if>
- <if test="fEname != null and fEname != ''">#{fEname},</if>
- <if test="fUncode != null">#{fUncode},</if>
- <if test="fTeu != null">#{fTeu},</if>
- <if test="fCbm != null">#{fCbm},</if>
- <if test="fWeight != null">#{fWeight},</if>
- <if test="fCntrsize != null">#{fCntrsize},</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="updateTCntr" parameterType="TCntr">
- update t_cntr
- <trim prefix="SET" suffixOverrides=",">
- <if test="fType != null">f_type = #{fType},</if>
- <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
- <if test="fName != null and fName != ''">f_name = #{fName},</if>
- <if test="fEname != null and fEname != ''">f_ename = #{fEname},</if>
- <if test="fUncode != null">f_uncode = #{fUncode},</if>
- <if test="fTeu != null">f_teu = #{fTeu},</if>
- <if test="fCbm != null">f_cbm = #{fCbm},</if>
- <if test="fWeight != null">f_weight = #{fWeight},</if>
- <if test="fCntrsize != null">f_cntrsize = #{fCntrsize},</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="deleteTCntrById" parameterType="Long">
- delete from t_cntr where f_id = #{fId}
- </delete>
- <delete id="deleteTCntrByIds" parameterType="String">
- delete from t_cntr where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <select id="selectRcntrName" parameterType="TCntr" resultType="map">
- SELECT
- f_id as fId,
- f_no as fNo
- FROM
- t_cntr
- <where>
- f_status = 'T'
- <if test="fNo != null and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
- </where>
- ORDER BY CONVERT(f_name USING gbk) asc
- </select>
- <select id="selectTCntrFNo" resultType="string">
- SELECT DISTINCT
- f_no
- FROM
- t_cntr
- where f_status = 'T'
- ORDER BY CONVERT(f_name USING gbk) asc
- </select>
- <select id="selectRcntrFId" parameterType="TCntr" resultType="long">
- SELECT
- f_id as fId
- FROM
- t_cntr
- where f_no = #{fNo}
- and f_status = 'T'
- ORDER BY CONVERT(f_name USING gbk) asc
- </select>
- <select id="selectTcnrFno" parameterType="object" resultMap="TCntrResult">
- SELECT
- f_id,
- f_no
- FROM
- t_cntr
- WHERE
- f_no = #{fNo}
- </select>
- <select id="selectTcnrFName" parameterType="object" resultMap="TCntrResult">
- SELECT
- f_id,
- f_no
- FROM
- t_cntr
- WHERE
- f_name = #{fName}
- </select>
- </mapper>
|