| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <?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.zd.airbottle.mapper.QpSupplierMapper">
- <resultMap type="com.zd.airbottle.domain.QpSupplier" id="QpSupplierResult">
- <result property="id" column="id"/>
- <result property="companyName" column="company_name"/>
- <result property="companyShort" column="company_short"/>
- <result property="contacts" column="contacts"/>
- <result property="phone" column="phone"/>
- <result property="auditTime" column="audit_time"/>
- <result property="accountId" column="account_id"/>
- <result property="deptId" column="dept_id"/>
- <result property="deptName" column="dept_name"/>
- <result property="state" column="state"/>
- <result property="status" column="status"/>
- <result property="businessRecord" column="business_record"/>
- <result property="businessAddress" column="business_address"/>
- <result property="createBy" column="create_by"/>
- <result property="userId" column="user_id"/>
- <result property="updateTime" column="update_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="createTime" column="create_time"/>
- </resultMap>
- <sql id="selectQpSupplierVo">
- select id,
- company_name,
- company_short,
- contacts,
- phone,
- account_id,
- dept_id,
- dept_name,
- audit_time,
- state,
- status,
- business_record,
- business_address,
- create_by,
- user_id,
- update_time,
- update_by,
- create_time
- from qp_supplier
- </sql>
- <sql id="selectQpSupplierListVo">
- select t.id,
- t.company_name,
- t.company_short,
- t.contacts,
- t.phone,
- t.account_id,
- t.dept_id,
- t.dept_name,
- t.audit_time,
- t.state,
- t.status,
- t.business_record,
- t.business_address,
- t.create_by,
- t.user_id,
- t.update_time,
- t.update_by,
- t.create_time
- from qp_supplier as t
- </sql>
- <select id="selectQpSupplierList" parameterType="com.zd.airbottle.domain.QpSupplier" resultMap="QpSupplierResult">
- <include refid="selectQpSupplierListVo"/>
- <where>
- <if test="companyName != null and companyName != ''">and t.company_name like concat('%', #{companyName},
- '%')
- </if>
- <if test="companyShort != null and companyShort != ''">and t.company_short = #{companyShort}</if>
- <if test="contacts != null and contacts != ''">and t.contacts = #{contacts}</if>
- <if test="state != null ">and t.state = #{state}</if>
- <if test="status != null ">and t.status = #{status}</if>
- <if test="accountId != null ">and t.account_id = #{accountId}</if>
- <if test="deptId != null ">and t.dept_id = #{deptId}</if>
- <if test="deptName != null ">and t.dept_name = #{deptName}</if>
- <if test="auditTime != null ">and t.audit_time = #{auditTime}</if>
- <if test="phone != null and phone != ''">and t.phone = #{phone}</if>
- <if test="businessRecord != null and businessRecord != ''">and t.business_record = #{businessRecord}</if>
- <if test="businessAddress != null and businessAddress != ''">and t.business_address = #{businessAddress}</if>
- <if test="userId != null ">and t.user_id = #{userId}</if>
- <if test="searchValue !=null and searchValue!=''">
- and (t.company_name like concat('%', #{searchValue},
- '%')
- or t.contacts like concat('%', #{searchValue},
- '%')
- or t.phone like concat('%', #{searchValue},
- '%'))
- </if>
- <if test="ids !=null and ids.size>0">
- and t.id in
- <foreach item="id" collection="ids" open="(" separator="," close=")">
- #{id}
- </foreach>
- </if>
- </where>
- </select>
- <select id="selectQpSupplierById" parameterType="java.lang.Long" resultMap="QpSupplierResult">
- <include refid="selectQpSupplierVo"/>
- where id = #{id}
- </select>
- <select id="checkName" resultType="java.lang.Boolean">
- select count(*) from qp_supplier
- where
- <choose>
- <when test="name!=null and name !='' and type!=null and type=2">
- company_short = #{name}
- </when>
- <otherwise>
- company_name like concat('%', #{name}, '%')
- </otherwise>
- </choose>
- </select>
- <select id="selectQpSupplierListByIds" resultType="com.zd.airbottle.domain.QpSupplier">
- <include refid="selectQpSupplierVo"/>
- where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <select id="selectQpSupplierByAccountId" resultType="com.zd.airbottle.domain.QpSupplier">
- <include refid="selectQpSupplierVo"/>
- where account_id = #{accountId}
- </select>
- <select id="getByIds" resultType="com.zd.airbottle.domain.QpSupplier">
- <include refid="selectQpSupplierVo"/>
- where id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <insert id="insertQpSupplier" parameterType="com.zd.airbottle.domain.QpSupplier" useGeneratedKeys="true"
- keyProperty="id">
- insert into qp_supplier
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="companyName != null">company_name,</if>
- <if test="companyShort != null">company_short,</if>
- <if test="contacts != null">contacts,</if>
- <if test="phone != null">phone,</if>
- <if test="accountId != null">account_id,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="deptName != null">dept_name,</if>
- <if test="auditTime != null">audit_time,</if>
- <if test="state != null">state,</if>
- <if test="status != null">status,</if>
- <if test="businessRecord != null">business_record,</if>
- <if test="businessAddress != null">business_address,</if>
- <if test="createBy != null">create_by,</if>
- <if test="userId != null">user_id,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="createTime != null">create_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="companyName != null">#{companyName},</if>
- <if test="companyShort != null">#{companyShort},</if>
- <if test="contacts != null">#{contacts},</if>
- <if test="phone != null">#{phone},</if>
- <if test="accountId != null">#{accountId},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="deptName != null">#{deptName},</if>
- <if test="auditTime != null">#{auditTime},</if>
- <if test="state != null">#{state},</if>
- <if test="status != null">#{status},</if>
- <if test="businessRecord != null">#{businessRecord},</if>
- <if test="businessAddress != null">#{businessAddress},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="userId != null">#{userId},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="createTime != null">#{createTime},</if>
- </trim>
- </insert>
- <update id="updateQpSupplier" parameterType="com.zd.airbottle.domain.QpSupplier">
- update qp_supplier
- <trim prefix="SET" suffixOverrides=",">
- <if test="companyName != null">company_name = #{companyName},</if>
- <if test="companyShort != null">company_short = #{companyShort},</if>
- <if test="contacts != null">contacts = #{contacts},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="accountId != null">account_id=#{accountId},</if>
- <if test="auditTime != null">audit_time = #{auditTime},</if>
- <if test="state != null">state = #{state},</if>
- <if test="status != null">status = #{status},</if>
- <if test="businessRecord != null">business_record = #{businessRecord},</if>
- <if test="businessAddress != null">business_address = #{businessAddress},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteQpSupplierById">
- delete
- from qp_supplier
- where id = #{id}
- </delete>
- <delete id="deleteQpSupplierByIds">
- delete from qp_supplier where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|