121 lines
6.9 KiB
XML
121 lines
6.9 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.EmisContinentMapper">
|
|
|
|
<resultMap type="EmisContinent" id="EmisContinentResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="name" column="name" />
|
|
<result property="nameEn" column="name_en" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="code" column="code" />
|
|
<result property="twoCode" column="two_code" />
|
|
<result property="threeCode" column="three_code" />
|
|
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisContinentVo">
|
|
select id, name, name_en, order_num, parent_id, code, two_code, three_code, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time from emis_continent
|
|
</sql>
|
|
|
|
<select id="selectEmisContinentList" parameterType="EmisContinent" resultMap="EmisContinentResult">
|
|
<include refid="selectEmisContinentVo"/>
|
|
<where>
|
|
<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="orderNum != null "> and order_num = #{orderNum}</if>
|
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
|
|
<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>
|
|
order by order_num desc
|
|
</select>
|
|
|
|
<select id="selectEmisContinentById" parameterType="Integer" resultMap="EmisContinentResult">
|
|
select id, name, name_en, order_num, parent_id, code, two_code, three_code, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time
|
|
from emis_continent a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisContinent" parameterType="EmisContinent">
|
|
insert into emis_continent
|
|
<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="orderNum != null">order_num,</if>
|
|
<if test="parentId != null">parent_id,</if>
|
|
<if test="code != null and code != ''">code,</if>
|
|
<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>
|
|
</trim>
|
|
<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="orderNum != null">#{orderNum},</if>
|
|
<if test="parentId != null">#{parentId},</if>
|
|
<if test="code != null and code != ''">#{code},</if>
|
|
<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>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisContinent" parameterType="EmisContinent">
|
|
update emis_continent
|
|
<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="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
|
<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="deleteEmisContinentById" parameterType="Integer">
|
|
delete from emis_continent where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisContinentByIds" parameterType="String">
|
|
delete from emis_continent where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |