175 lines
12 KiB
XML
175 lines
12 KiB
XML
<?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.xdadan.erp.emis.mapper.EmisDestinationMapper">
|
|
|
|
<resultMap type="EmisDestination" id="EmisDestinationResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="destCode" column="dest_code" />
|
|
<result property="destName" column="dest_name" />
|
|
<result property="destNameEn" column="dest_name_en" />
|
|
<result property="status" column="status" />
|
|
<result property="lineCode" column="line_code" />
|
|
<result property="country" column="country" />
|
|
<result property="siteCode" column="site_code" />
|
|
<result property="province" column="province" />
|
|
<result property="city" column="city" />
|
|
<result property="county" column="county" />
|
|
<result property="town" column="town" />
|
|
<result property="isHinterland" column="is_hinterland" />
|
|
<result property="countryAreaId" column="country_area_id" />
|
|
|
|
<association property="lineName" column="line_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectLineNameByCode"/>
|
|
<association property="countryName" column="country" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryNameByCode"/>
|
|
|
|
<association property="siteName" column="site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
<association property="countryAreaName" column="country_area_id" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectCountryAreaNameById"/>
|
|
</resultMap>
|
|
|
|
<!-- <association property="provinceName" column="province" select="selectRegionNameByCode"/>-->
|
|
<!-- <association property="cityName" column="city" select="selectRegionNameByCode"/>-->
|
|
<!-- <association property="countyName" column="county" select="selectRegionNameByCode"/>-->
|
|
<!-- <association property="townName" column="town" select="selectRegionNameByCode"/>-->
|
|
|
|
<sql id="selectEmisDestinationVo">
|
|
select id, dest_code, dest_name, dest_name_en, status, line_code, country, site_code, province, city, county, town, is_hinterland, country_area_id, remark, tenant_id, del_flag, create_by, create_site, create_time, update_by, update_site, update_time from emis_destination
|
|
</sql>
|
|
|
|
|
|
<select id="selectEmisDestinationList" parameterType="EmisDestination" resultMap="EmisDestinationResult">
|
|
<include refid="selectEmisDestinationVo"/>
|
|
<where>
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="destCode != null and destCode != ''"> and dest_code=#{destCode}</if>
|
|
<if test="destName != null and destName != ''"> and dest_name like concat('%', #{destName}, '%')</if>
|
|
<if test="destNameEn != null and destNameEn != ''"> and dest_name_en like concat('%', #{destNameEn}, '%')</if>
|
|
<if test="status != null "> and status = #{status}</if>
|
|
<if test="lineCode != null and lineCode != ''"> and line_code=#{lineCode}</if>
|
|
<if test="country != null and country != ''"> and country=#{country}</if>
|
|
<if test="siteCode != null and siteCode != ''"> and site_code like concat('%', #{siteCode}, '%')</if>
|
|
<if test="province != null and province != ''"> and province like concat('%', #{province}, '%')</if>
|
|
<if test="city != null and city != ''"> and city like concat('%', #{city}, '%')</if>
|
|
<if test="county != null and county != ''"> and county like concat('%', #{county}, '%')</if>
|
|
<if test="town != null and town != ''"> and town like concat('%', #{town}, '%')</if>
|
|
<if test="countryAreaId != null "> and country_area_id = #{countryAreaId}</if>
|
|
<if test="isHinterland != null "> and is_hinterland = #{isHinterland}</if>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectEmisDestinationById" parameterType="Long" resultMap="EmisDestinationResult">
|
|
select id, dest_code, dest_name, dest_name_en, status, line_code, country, site_code, province, city, county, town, is_hinterland, country_area_id, remark, tenant_id, del_flag, create_by, create_site, create_time, update_by, update_site, update_time
|
|
from emis_destination a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<select id="getEmisDestinationByDestCode" parameterType="String" resultMap="EmisDestinationResult">
|
|
select id, dest_code, dest_name, dest_name_en, status, line_code, country, site_code, province, city, county, town, is_hinterland, country_area_id, remark, tenant_id, del_flag, create_by, create_site, create_time, update_by, update_site, update_time
|
|
from emis_destination a
|
|
where a.del_flag='0' and a.dest_code = #{destCode}
|
|
</select>
|
|
|
|
<insert id="insertEmisDestination" parameterType="EmisDestination">
|
|
insert into emis_destination
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="destCode != null and destCode != ''">dest_code,</if>
|
|
<if test="destName != null and destName != ''">dest_name,</if>
|
|
<if test="destNameEn != null and destNameEn != ''">dest_name_en,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="lineCode != null and lineCode != ''">line_code,</if>
|
|
<if test="country != null and country != ''">country,</if>
|
|
<if test="siteCode != null and siteCode != ''">site_code,</if>
|
|
<if test="province != null and province != ''">province,</if>
|
|
<if test="city != null and city != ''">city,</if>
|
|
<if test="county != null and county != ''">county,</if>
|
|
<if test="town != null and town != ''">town,</if>
|
|
<if test="isHinterland != null">is_hinterland,</if>
|
|
<if test="countryAreaId != null">country_area_id,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="destCode != null and destCode != ''">#{destCode},</if>
|
|
<if test="destName != null and destName != ''">#{destName},</if>
|
|
<if test="destNameEn != null and destNameEn != ''">#{destNameEn},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="lineCode != null and lineCode != ''">#{lineCode},</if>
|
|
<if test="country != null and country != ''">#{country},</if>
|
|
<if test="siteCode != null and siteCode != ''">#{siteCode},</if>
|
|
<if test="province != null and province != ''">#{province},</if>
|
|
<if test="city != null and city != ''">#{city},</if>
|
|
<if test="county != null and county != ''">#{county},</if>
|
|
<if test="town != null and town != ''">#{town},</if>
|
|
<if test="isHinterland != null">#{isHinterland},</if>
|
|
<if test="countryAreaId != null">#{countryAreaId},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisDestination" parameterType="EmisDestination">
|
|
update emis_destination
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="destCode != null and destCode != ''">dest_code = #{destCode},</if>
|
|
<if test="destName != null and destName != ''">dest_name = #{destName},</if>
|
|
<if test="destNameEn != null and destNameEn != ''">dest_name_en = #{destNameEn},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if>
|
|
<if test="country != null and country != ''">country = #{country},</if>
|
|
<if test="siteCode != null and siteCode != ''">site_code = #{siteCode},</if>
|
|
<if test="province != null and province != ''">province = #{province},</if>
|
|
<if test="city != null and city != ''">city = #{city},</if>
|
|
<if test="county != null and county != ''">county = #{county},</if>
|
|
<if test="town != null and town != ''">town = #{town},</if>
|
|
<if test="isHinterland != null">is_hinterland = #{isHinterland},</if>
|
|
<if test="countryAreaId != null">country_area_id = #{countryAreaId},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisDestinationById" parameterType="Long">
|
|
delete from emis_destination where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisDestinationByIds" parameterType="String">
|
|
delete from emis_destination where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |