|
@@ -0,0 +1,155 @@
|
|
|
+<?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.business.mapper.TOrganizationMapper">
|
|
|
+
|
|
|
+ <resultMap type="TOrganization" id="TOrganizationResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="code" column="code" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="provinceCode" column="province_code" />
|
|
|
+ <result property="cityCode" column="city_code" />
|
|
|
+ <result property="countryCode" column="country_code" />
|
|
|
+ <result property="concat" column="concat" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
+ <result property="topId" column="top_id" />
|
|
|
+ <result property="sort" column="sort" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="longitude" column="longitude" />
|
|
|
+ <result property="latitude" column="latitude" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="revision" column="revision" />
|
|
|
+ <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="selectTOrganizationVo">
|
|
|
+ select id, name, code, type, province_code, city_code, country_code, concat, phone, status, parent_id, top_id, sort, address, longitude, latitude, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_organization
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTOrganizationList" parameterType="TOrganization" resultMap="TOrganizationResult">
|
|
|
+ <include refid="selectTOrganizationVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
|
|
|
+ <if test="type != null "> and type = #{type}</if>
|
|
|
+ <if test="provinceCode != null and provinceCode != ''"> and province_code = #{provinceCode}</if>
|
|
|
+ <if test="cityCode != null and cityCode != ''"> and city_code = #{cityCode}</if>
|
|
|
+ <if test="countryCode != null and countryCode != ''"> and country_code = #{countryCode}</if>
|
|
|
+ <if test="concat != null and concat != ''"> and concat = #{concat}</if>
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
+ <if test="topId != null "> and top_id = #{topId}</if>
|
|
|
+ <if test="sort != null "> and sort = #{sort}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
|
|
+ <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
|
|
+ <if test="revision != null "> and revision = #{revision}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTOrganizationById" parameterType="Long" resultMap="TOrganizationResult">
|
|
|
+ <include refid="selectTOrganizationVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTOrganization" parameterType="TOrganization" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into t_organization
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="code != null">code,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="provinceCode != null">province_code,</if>
|
|
|
+ <if test="cityCode != null">city_code,</if>
|
|
|
+ <if test="countryCode != null">country_code,</if>
|
|
|
+ <if test="concat != null">concat,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
+ <if test="topId != null">top_id,</if>
|
|
|
+ <if test="sort != null">sort,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="longitude != null">longitude,</if>
|
|
|
+ <if test="latitude != null">latitude,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="revision != null">revision,</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="name != null">#{name},</if>
|
|
|
+ <if test="code != null">#{code},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="provinceCode != null">#{provinceCode},</if>
|
|
|
+ <if test="cityCode != null">#{cityCode},</if>
|
|
|
+ <if test="countryCode != null">#{countryCode},</if>
|
|
|
+ <if test="concat != null">#{concat},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
+ <if test="topId != null">#{topId},</if>
|
|
|
+ <if test="sort != null">#{sort},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="longitude != null">#{longitude},</if>
|
|
|
+ <if test="latitude != null">#{latitude},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="revision != null">#{revision},</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="updateTOrganization" parameterType="TOrganization">
|
|
|
+ update t_organization
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="code != null">code = #{code},</if>
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="provinceCode != null">province_code = #{provinceCode},</if>
|
|
|
+ <if test="cityCode != null">city_code = #{cityCode},</if>
|
|
|
+ <if test="countryCode != null">country_code = #{countryCode},</if>
|
|
|
+ <if test="concat != null">concat = #{concat},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
+ <if test="topId != null">top_id = #{topId},</if>
|
|
|
+ <if test="sort != null">sort = #{sort},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="longitude != null">longitude = #{longitude},</if>
|
|
|
+ <if test="latitude != null">latitude = #{latitude},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="revision != null">revision = #{revision},</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 id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTOrganizationById" parameterType="Long">
|
|
|
+ delete from t_organization where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTOrganizationByIds" parameterType="String">
|
|
|
+ delete from t_organization where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|