|
|
@@ -0,0 +1,269 @@
|
|
|
+<?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.izouma.awesomeadmin.dao.CompanyInfoMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
+ <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
|
|
|
+ <result column="title" property="title" jdbcType="VARCHAR"/>
|
|
|
+ <result column="remark" property="remark" jdbcType="VARCHAR"/>
|
|
|
+ <result column="rank" property="rank" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ id,
|
|
|
+
|
|
|
+ del_flag,
|
|
|
+
|
|
|
+ title,
|
|
|
+
|
|
|
+ remark,
|
|
|
+
|
|
|
+ rank,
|
|
|
+
|
|
|
+ </trim>
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from company_info
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from company_info
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.CompanyInfo" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into company_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id!= null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!= null">
|
|
|
+ del_flag,
|
|
|
+ </if>
|
|
|
+ <if test="title!= null">
|
|
|
+ title,
|
|
|
+ </if>
|
|
|
+ <if test="remark!= null">
|
|
|
+ remark,
|
|
|
+ </if>
|
|
|
+ <if test="rank!= null">
|
|
|
+ rank,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="rank != null">
|
|
|
+ #{rank,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ update company_info
|
|
|
+ <set>
|
|
|
+ <if test="id != null">
|
|
|
+ id= #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title= #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">
|
|
|
+ remark= #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="rank != null">
|
|
|
+ rank= #{rank,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <select id="queryCompanyInfoByPage" parameterType="java.util.Map"
|
|
|
+ resultType="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from company_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
+ and id = #{record.id}
|
|
|
+ </if>
|
|
|
+ <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
+ and del_flag = #{record.delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.title != null and !"".equals(record.title)">
|
|
|
+ and title = #{record.title}
|
|
|
+ </if>
|
|
|
+ <if test="record.remark != null and !"".equals(record.remark)">
|
|
|
+ and remark = #{record.remark}
|
|
|
+ </if>
|
|
|
+ <if test="record.rank != null and !"".equals(record.rank)">
|
|
|
+ and rank = #{record.rank}
|
|
|
+ </if>
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ OR title LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="record.advancedQuery != null and !"".equals(record.advancedQuery)">
|
|
|
+ <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
|
|
|
+ <choose>
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ order by rank desc,id desc
|
|
|
+ </select>
|
|
|
+ <select id="queryAllCompanyInfo" parameterType="java.util.Map"
|
|
|
+ resultType="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from company_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ and del_flag = #{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="title != null and !"".equals(title)">
|
|
|
+ and title = #{title}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ OR title LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ <if test="advancedQuery != null and !"".equals(advancedQuery)">
|
|
|
+ <foreach item="item" index="index" collection="advancedQuery.split('_;')">
|
|
|
+ <choose>
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by rank desc, id desc
|
|
|
+ </select>
|
|
|
+ <select id="queryCompanyInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from company_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ and del_flag = #{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="title != null and !"".equals(title)">
|
|
|
+ and title = #{title}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ and rank = #{rank}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <update id="delete">
|
|
|
+ UPDATE company_info SET del_flag = 'Y'
|
|
|
+ <where>
|
|
|
+ AND id = #{id}
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+ <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.CompanyInfo">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from company_info
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+</mapper>
|
|
|
+
|