123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?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>
- 1 = 1
- <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>
- and del_flag = 0 order by id desc
- </select>
-
- <select id="selectTOrganizationById" parameterType="Long" resultMap="TOrganizationResult">
- <include refid="selectTOrganizationVo"/>
- where id = #{id} and del_flag = 0
- </select>
- <insert id="insertTOrganization" parameterType="TOrganization" useGeneratedKeys="true" keyProperty="id">
- insert into t_organization
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <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="id != null">#{id},</if>
- <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>
- ,revision = revision + 1
- where id = #{id}
- </update>
- <delete id="deleteTOrganizationById" parameterType="Long">
- update t_organization set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
- </delete>
- <delete id="deleteTOrganizationByIds" parameterType="String">
- update t_organization set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|