| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?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.usoftchina.saas.account.mapper.CompanyMapper">
- <resultMap id="FullResultMap" type="com.usoftchina.saas.account.po.Company">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="business_code" jdbcType="VARCHAR" property="businessCode"/>
- <result column="address" jdbcType="VARCHAR" property="address"/>
- <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
- <result column="uu" jdbcType="BIGINT" property="uu"/>
- <result column="creator_id" jdbcType="BIGINT" property="creatorId"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="updater_id" jdbcType="BIGINT" property="updaterId"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="fax" jdbcType="VARCHAR" property="fax"/>
- <result column="tel" jdbcType="VARCHAR" property="tel"/>
- <result column="signet" jdbcType="VARCHAR" property="signet"/>
- <result column="uu" jdbcType="VARCHAR" property="uu"/>
- <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
- </resultMap>
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.account.vo.CompanyBaseVO">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="logo_url" jdbcType="VARCHAR" property="logoUrl"/>
- </resultMap>
- <sql id="baseColumns">
- id,name,business_code,address,uu,creator_id,create_time,updater_id,update_time,fax,tel,signet,uu,logo_url
- </sql>
- <insert id="insert" parameterType="com.usoftchina.saas.account.po.Company"
- useGeneratedKeys="true" keyProperty="id">
- <selectKey resultType="java.lang.Long" keyProperty="id">
- SELECT LAST_INSERT_ID() AS ID
- </selectKey>
- insert into ac_company(name, business_code, address, logo_url, creator_id, create_time, updater_id, update_time,
- tel, fax, signet, uu)
- values (#{name,jdbcType=VARCHAR}, #{businessCode,jdbcType=VARCHAR},
- #{address,jdbcType=VARCHAR}, #{logoUrl,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT},
- #{createTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
- #{tel,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{signet,jdbcType=VARCHAR}, #{uu,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.account.po.Company"
- useGeneratedKeys="true" keyProperty="id">
- insert into ac_company
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="name != null">
- name,
- </if>
- <if test="businessCode != null">
- business_code,
- </if>
- <if test="address != null">
- address,
- </if>
- <if test="logoUrl != null">
- logo_url,
- </if>
- <if test="uu != null">
- uu,
- </if>
- <if test="creatorId != null">
- creator_id,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updaterId != null">
- updater_id,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="businessCode != null">
- #{businessCode,jdbcType=VARCHAR},
- </if>
- <if test="address != null">
- #{address,jdbcType=VARCHAR},
- </if>
- <if test="logoUrl != null">
- #{logoUrl,jdbcType=VARCHAR},
- </if>
- <if test="uu != null">
- #{uu,jdbcType=BIGINT},
- </if>
- <if test="creatorId != null">
- #{creatorId,jdbcType=BIGINT},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updaterId != null">
- #{updaterId,jdbcType=BIGINT},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="FullResultMap">
- select <include refid="baseColumns"/> from ac_company where id=#{id,jdbcType=BIGINT}
- </select>
- <select id="selectByName" parameterType="java.lang.String" resultMap="FullResultMap">
- select <include refid="baseColumns"/> from ac_company where name=#{name,jdbcType=VARCHAR}
- </select>
- <select id="selectByUu" parameterType="java.lang.Long" resultMap="FullResultMap">
- select <include refid="baseColumns"/> from ac_company where uu=#{uu,jdbcType=BIGINT}
- </select>
- <select id="selectByBusinessCode" parameterType="java.lang.String" resultMap="FullResultMap">
- select <include refid="baseColumns"/> from ac_company where business_code=#{businessCode,jdbcType=VARCHAR}
- </select>
- <select id="selectBaseByAccountId" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select ac_company.id,ac_company.name,ac_company.logo_url from ac_account_company,ac_company
- where ac_account_company.company_id=ac_company.id and ac_account_company.account_id=#{accountId,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from ac_company where id=#{id,jdbcType=BIGINT}
- </delete>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.account.dto.CompanyRegDTO">
- UPDATE ac_company
- <set>
- <if test="name != null">
- name = #{name, jdbcType=VARCHAR},
- </if>
- <if test="address != null">
- address = #{address,jdbcType=VARCHAR},
- </if>
- <if test="logoUrl != null">
- logo_url = #{logoUrl,jdbcType=VARCHAR},
- </if>
- <if test="tel != null">
- tel = #{tel,jdbcType=VARCHAR},
- </if>
- <if test="fax != null">
- fax = #{fax,jdbcType=VARCHAR},
- </if>
- <if test="signet != null">
- signet = #{signet,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id}
- </update>
- <update id="updateUUByPrimaryKey">
- UPDATE ac_company set uu = #{uu} where id = #{companyId}
- </update>
- </mapper>
|