| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?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.fs.company.mapper.CompanyDomainMapper">
- <resultMap type="CompanyDomain" id="CompanyDomainResult">
- <result property="id" column="id"/>
- <result property="domain" column="domain"/>
- <result property="remark" column="remark"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="status" column="status"/>
- <result property="createBy" column="create_by"/>
- <result property="updateBy" column="update_by"/>
- </resultMap>
- <sql id="selectCompanyDomainVo">
- select id, domain, remark, create_time, update_time, status, create_by, update_by
- from company_domain
- </sql>
- <select id="selectCompanyDomainList" parameterType="CompanyDomain" resultMap="CompanyDomainResult">
- <include refid="selectCompanyDomainVo"/>
- <where>
- <if test="domain != null and domain != ''">and domain LIKE CONCAT('%',#{domain},'%')</if>
- <if test="status != null ">and status = #{status}</if>
- </where>
- </select>
- <select id="selectCompanyDomainById" parameterType="Long" resultMap="CompanyDomainResult">
- <include refid="selectCompanyDomainVo"/>
- where id = #{id}
- </select>
- <insert id="insertCompanyDomain" parameterType="CompanyDomain" useGeneratedKeys="true" keyProperty="id">
- insert into company_domain
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="domain != null and domain != ''">domain,</if>
- <if test="remark != null">remark,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="status != null">status,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="domain != null and domain != ''">#{domain},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="status != null">#{status},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- </trim>
- </insert>
- <update id="updateCompanyDomain" parameterType="CompanyDomain">
- update company_domain
- <trim prefix="SET" suffixOverrides=",">
- <if test="domain != null and domain != ''">domain = #{domain},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteCompanyDomainById" parameterType="Long">
- delete
- from company_domain
- where id = #{id}
- </delete>
- <delete id="deleteCompanyDomainByIds" parameterType="String">
- delete from company_domain where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectCompanyDomainJoinInfo" resultType="com.fs.company.vo.CompanyDomainVo">
- SELECT cd.*,
- COUNT(cdb.domain_id) bindNum
- FROM company_domain cd
- LEFT JOIN company_domain_bind cdb ON cd.id = cdb.domain_id
- <where>
- <if test="domain != null and domain != ''">and cd.domain LIKE CONCAT('%',#{domain},'%')</if>
- <if test="status != null ">and cd.status = #{status}</if>
- <if test="ids != null ">and cd.id IN
- <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">#{item}</foreach>
- </if>
- </where>
- GROUP BY
- cd.id
- ORDER BY cd.create_time DESC
- </select>
- <insert id="batchDomainInfo">
- insert into company_domain (
- domain,
- remark,
- create_time,
- update_time,
- status,
- create_by,
- update_by
- )
- values
- <foreach collection="list" item="item" separator=",">
- (
- #{item.domain},
- #{item.remark},
- #{item.createTime},
- #{item.updateTime},
- #{item.status},
- #{item.createBy},
- #{item.updateBy}
- )
- </foreach>
- </insert>
- </mapper>
|