2023-11-27 04:50:09 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
2023-12-12 06:38:11 +00:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2023-11-27 04:50:09 +00:00
|
|
|
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCountryMapper">
|
2023-12-12 06:38:11 +00:00
|
|
|
|
2023-11-27 04:50:09 +00:00
|
|
|
<resultMap type="EmisCountry" id="EmisCountryResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="name" column="name" />
|
|
|
|
|
<result property="nameEn" column="name_en" />
|
|
|
|
|
<result property="code" column="code" />
|
2024-03-20 08:33:49 +00:00
|
|
|
<result property="telAreaCode" column="tel_area_code" />
|
2023-11-27 04:50:09 +00:00
|
|
|
<result property="continentId" column="continent_id" />
|
2024-03-19 12:54:06 +00:00
|
|
|
<result property="orderNum" column="order_num" />
|
2023-11-27 04:50:09 +00:00
|
|
|
<result property="twoCode" column="two_code" />
|
|
|
|
|
<result property="threeCode" column="three_code" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEmisCountryVo">
|
2024-03-20 08:33:49 +00:00
|
|
|
select id, name, name_en, code, tel_area_code, continent_id, order_num, two_code, three_code, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time from emis_country
|
2023-11-27 04:50:09 +00:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEmisCountryList" parameterType="EmisCountry" resultMap="EmisCountryResult">
|
|
|
|
|
<include refid="selectEmisCountryVo"/>
|
2023-12-12 06:38:11 +00:00
|
|
|
<where>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="id != null "> and id = #{id}</if>
|
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
<if test="nameEn != null and nameEn != ''"> and name_en like concat('%', #{nameEn}, '%')</if>
|
|
|
|
|
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
|
2024-03-20 08:33:49 +00:00
|
|
|
<if test="telAreaCode != null and telAreaCode != ''"> and tel_area_code like concat('%', #{telAreaCode}, '%')</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="continentId != null "> and continent_id = #{continentId}</if>
|
2024-03-19 12:54:06 +00:00
|
|
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="twoCode != null and twoCode != ''"> and two_code like concat('%', #{twoCode}, '%')</if>
|
|
|
|
|
<if test="threeCode != null and threeCode != ''"> and three_code like concat('%', #{threeCode}, '%')</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="createTime != null "> and create_time = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
|
|
|
</where>
|
2024-03-20 08:33:49 +00:00
|
|
|
order by create_time desc
|
2023-11-27 04:50:09 +00:00
|
|
|
</select>
|
2023-12-12 06:38:11 +00:00
|
|
|
|
2023-11-27 04:50:09 +00:00
|
|
|
<select id="selectEmisCountryById" parameterType="Integer" resultMap="EmisCountryResult">
|
2024-03-20 08:33:49 +00:00
|
|
|
select id, name, name_en, code, tel_area_code, continent_id, order_num, two_code, three_code, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time
|
2023-11-27 04:50:09 +00:00
|
|
|
from emis_country a
|
|
|
|
|
where a.id = #{id}
|
|
|
|
|
</select>
|
2023-12-12 06:38:11 +00:00
|
|
|
|
2023-11-27 04:50:09 +00:00
|
|
|
<insert id="insertEmisCountry" parameterType="EmisCountry">
|
|
|
|
|
insert into emis_country
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="name != null and name != ''">name,</if>
|
|
|
|
|
<if test="nameEn != null and nameEn != ''">name_en,</if>
|
|
|
|
|
<if test="code != null and code != ''">code,</if>
|
2024-03-20 08:33:49 +00:00
|
|
|
<if test="telAreaCode != null and telAreaCode != ''">tel_area_code,</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="continentId != null">continent_id,</if>
|
2024-03-19 12:54:06 +00:00
|
|
|
<if test="orderNum != null">order_num,</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="twoCode != null and twoCode != ''">two_code,</if>
|
|
|
|
|
<if test="threeCode != null and threeCode != ''">three_code,</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="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
2023-12-12 06:38:11 +00:00
|
|
|
</trim>
|
2023-11-27 04:50:09 +00:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
|
|
|
<if test="nameEn != null and nameEn != ''">#{nameEn},</if>
|
|
|
|
|
<if test="code != null and code != ''">#{code},</if>
|
2024-03-20 08:33:49 +00:00
|
|
|
<if test="telAreaCode != null and telAreaCode != ''">#{telAreaCode},</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="continentId != null">#{continentId},</if>
|
2024-03-19 12:54:06 +00:00
|
|
|
<if test="orderNum != null">#{orderNum},</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="twoCode != null and twoCode != ''">#{twoCode},</if>
|
|
|
|
|
<if test="threeCode != null and threeCode != ''">#{threeCode},</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="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
2023-12-12 06:38:11 +00:00
|
|
|
</trim>
|
2023-11-27 04:50:09 +00:00
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEmisCountry" parameterType="EmisCountry">
|
|
|
|
|
update emis_country
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
|
<if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if>
|
|
|
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
2024-03-20 08:33:49 +00:00
|
|
|
<if test="telAreaCode != null and telAreaCode != ''">tel_area_code = #{telAreaCode},</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="continentId != null">continent_id = #{continentId},</if>
|
2024-03-19 12:54:06 +00:00
|
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
2023-11-27 04:50:09 +00:00
|
|
|
<if test="twoCode != null and twoCode != ''">two_code = #{twoCode},</if>
|
|
|
|
|
<if test="threeCode != null and threeCode != ''">three_code = #{threeCode},</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="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisCountryById" parameterType="Integer">
|
|
|
|
|
delete from emis_country where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmisCountryByIds" parameterType="String">
|
2023-12-12 06:38:11 +00:00
|
|
|
delete from emis_country where id in
|
2023-11-27 04:50:09 +00:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|