|
@@ -0,0 +1,85 @@
|
|
|
+<?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.pj.tb_company.TbCompanyMapper">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- ================================== 查询相关 ================================== -->
|
|
|
+ <!-- select id, name, legal_person, id_card, contact, business_license, bank_no, bank_name, bank_account, duty_paragraph, address_ids, address, detail, create_time, create_by, create_name, update_time, update_by, update_name, delete_status, is_lock, trade_area_id, trade_area_name from tb_company -->
|
|
|
+
|
|
|
+ <!-- 通用映射:自动模式 -->
|
|
|
+ <resultMap id="model" autoMapping="true" type="com.pj.tb_company.TbCompany"></resultMap>
|
|
|
+
|
|
|
+ <!-- 公共查询sql片段 -->
|
|
|
+ <sql id="select_sql">
|
|
|
+ select *
|
|
|
+ from tb_company
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
|
|
|
+ <select id="getList" resultMap="model">
|
|
|
+ <include refid="select_sql"></include>
|
|
|
+ <where>
|
|
|
+ <if test=' this.has("id") '> and id = #{id} </if>
|
|
|
+ <if test=' this.has("name") '> and name = #{name} </if>
|
|
|
+ <if test=' this.has("legalPerson") '> and legal_person = #{legalPerson} </if>
|
|
|
+ <if test=' this.has("idCard") '> and id_card = #{idCard} </if>
|
|
|
+ <if test=' this.has("contact") '> and contact = #{contact} </if>
|
|
|
+ <if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>
|
|
|
+ <if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
|
|
|
+ <if test=' this.has("bankAccount") '> and bank_account = #{bankAccount} </if>
|
|
|
+ <if test=' this.has("dutyParagraph") '> and duty_paragraph = #{dutyParagraph} </if>
|
|
|
+ <if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
|
|
|
+ <if test=' this.has("address") '> and address = #{address} </if>
|
|
|
+ <if test=' this.has("detail") '> and detail = #{detail} </if>
|
|
|
+ <if test=' this.has("createTime") '> and create_time = #{createTime} </if>
|
|
|
+ <if test=' this.has("createBy") '> and create_by = #{createBy} </if>
|
|
|
+ <if test=' this.has("createName") '> and create_name = #{createName} </if>
|
|
|
+ <if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
|
|
|
+ <if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
|
|
|
+ <if test=' this.has("updateName") '> and update_name = #{updateName} </if>
|
|
|
+ <if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
|
|
|
+ <if test=' this.has("isLock") '> and is_lock = #{isLock} </if>
|
|
|
+ <if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
|
|
|
+ <if test=' this.has("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>
|
|
|
+ </where>
|
|
|
+ order by
|
|
|
+ <choose>
|
|
|
+ <when test='sortType == 1'> id desc </when>
|
|
|
+ <when test='sortType == 2'> name desc </when>
|
|
|
+ <when test='sortType == 3'> legal_person desc </when>
|
|
|
+ <when test='sortType == 4'> id_card desc </when>
|
|
|
+ <when test='sortType == 5'> contact desc </when>
|
|
|
+ <when test='sortType == 6'> bank_no desc </when>
|
|
|
+ <when test='sortType == 7'> bank_name desc </when>
|
|
|
+ <when test='sortType == 8'> bank_account desc </when>
|
|
|
+ <when test='sortType == 9'> duty_paragraph desc </when>
|
|
|
+ <when test='sortType == 10'> address_ids desc </when>
|
|
|
+ <when test='sortType == 11'> address desc </when>
|
|
|
+ <when test='sortType == 12'> detail desc </when>
|
|
|
+ <when test='sortType == 13'> create_time desc </when>
|
|
|
+ <when test='sortType == 14'> create_by desc </when>
|
|
|
+ <when test='sortType == 15'> create_name desc </when>
|
|
|
+ <when test='sortType == 16'> update_time desc </when>
|
|
|
+ <when test='sortType == 17'> update_by desc </when>
|
|
|
+ <when test='sortType == 18'> update_name desc </when>
|
|
|
+ <when test='sortType == 19'> delete_status desc </when>
|
|
|
+ <when test='sortType == 20'> is_lock desc </when>
|
|
|
+ <when test='sortType == 21'> trade_area_id desc </when>
|
|
|
+ <when test='sortType == 22'> trade_area_name desc </when>
|
|
|
+ <otherwise> id desc </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|