|
@@ -0,0 +1,135 @@
|
|
|
+<?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.zkqy.business.mapper.SupplierMapper">
|
|
|
+
|
|
|
+ <resultMap type="Supplier" id="SupplierResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="supplierNo" column="supplier_no" />
|
|
|
+ <result property="supplierName" column="supplier_name" />
|
|
|
+ <result property="abutmentBy" column="abutment_by" />
|
|
|
+ <result property="abutment" column="abutment" />
|
|
|
+ <result property="contactNumber" column="contact_number" />
|
|
|
+ <result property="representative" column="representative" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="state" column="state" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="createById" column="create_by_id" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateById" column="update_by_id" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="taskProcessKey" column="task_process_key" />
|
|
|
+ <result property="taskNodeKey" column="task_node_key" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSupplierVo">
|
|
|
+ select id, supplier_no, supplier_name, abutment_by, abutment, contact_number, representative, address, state, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key from supplier
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSupplierList" parameterType="Supplier" resultMap="SupplierResult">
|
|
|
+ <include refid="selectSupplierVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
|
|
|
+ <if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
+ <if test="abutmentBy != null and abutmentBy != ''"> and abutment_by = #{abutmentBy}</if>
|
|
|
+ <if test="abutment != null and abutment != ''"> and abutment = #{abutment}</if>
|
|
|
+ <if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
|
|
|
+ <if test="representative != null and representative != ''"> and representative = #{representative}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="state != null and state != ''"> and state = #{state}</if>
|
|
|
+ <if test="createById != null "> and create_by_id = #{createById}</if>
|
|
|
+ <if test="updateById != null "> and update_by_id = #{updateById}</if>
|
|
|
+ <if test="taskProcessKey != null and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
|
|
|
+ <if test="taskNodeKey != null and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSupplierById" parameterType="Long" resultMap="SupplierResult">
|
|
|
+ <include refid="selectSupplierVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSupplier" parameterType="Supplier" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into supplier
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="supplierNo != null">supplier_no,</if>
|
|
|
+ <if test="supplierName != null">supplier_name,</if>
|
|
|
+ <if test="abutmentBy != null">abutment_by,</if>
|
|
|
+ <if test="abutment != null">abutment,</if>
|
|
|
+ <if test="contactNumber != null">contact_number,</if>
|
|
|
+ <if test="representative != null">representative,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="state != null">state,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createById != null">create_by_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateById != null">update_by_id,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key,</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="supplierNo != null">#{supplierNo},</if>
|
|
|
+ <if test="supplierName != null">#{supplierName},</if>
|
|
|
+ <if test="abutmentBy != null">#{abutmentBy},</if>
|
|
|
+ <if test="abutment != null">#{abutment},</if>
|
|
|
+ <if test="contactNumber != null">#{contactNumber},</if>
|
|
|
+ <if test="representative != null">#{representative},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="state != null">#{state},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createById != null">#{createById},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateById != null">#{updateById},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">#{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">#{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateSupplier" parameterType="Supplier">
|
|
|
+ update supplier
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="supplierNo != null">supplier_no = #{supplierNo},</if>
|
|
|
+ <if test="supplierName != null">supplier_name = #{supplierName},</if>
|
|
|
+ <if test="abutmentBy != null">abutment_by = #{abutmentBy},</if>
|
|
|
+ <if test="abutment != null">abutment = #{abutment},</if>
|
|
|
+ <if test="contactNumber != null">contact_number = #{contactNumber},</if>
|
|
|
+ <if test="representative != null">representative = #{representative},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="state != null">state = #{state},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
|
|
|
+ <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteSupplierById" parameterType="Long">
|
|
|
+ delete from supplier where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSupplierByIds" parameterType="String">
|
|
|
+ delete from supplier where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|