|
@@ -0,0 +1,285 @@
|
|
|
|
|
+<?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">
|
|
|
|
|
+<!-- namespace必须指向DAO接口 -->
|
|
|
|
|
+<mapper namespace="com.jpsoft.employment.modules.base.dao.WorkOrderDAO">
|
|
|
|
|
+ <resultMap id="WorkOrderMap" type="com.jpsoft.employment.modules.base.entity.WorkOrder">
|
|
|
|
|
+ <id property="id" column="id_" />
|
|
|
|
|
+ <result property="number" column="number_" />
|
|
|
|
|
+ <result property="title" column="title_" />
|
|
|
|
|
+ <result property="address" column="address_" />
|
|
|
|
|
+ <result property="date" column="date_" />
|
|
|
|
|
+ <result property="tag" column="tag_" />
|
|
|
|
|
+ <result property="image" column="image_" />
|
|
|
|
|
+ <result property="status" column="status_" />
|
|
|
|
|
+ <result property="price" column="price_" />
|
|
|
|
|
+ <result property="location" column="location_" />
|
|
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
|
|
+ <result property="map" column="map_" />
|
|
|
|
|
+ <result property="constructionLocation" column="construction_location" />
|
|
|
|
|
+ <result property="environment" column="environment" />
|
|
|
|
|
+ <result property="volume" column="volume_" />
|
|
|
|
|
+ <result property="technicianId" column="technician_id" />
|
|
|
|
|
+ <result property="payStatus" column="pay_status" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
|
+ <result property="customerName" column="customer_name" />
|
|
|
|
|
+ <result property="customerPhone" column="customer_phone" />
|
|
|
|
|
+ <result property="viewNum" column="view_num" />
|
|
|
|
|
+ <result property="certificate" column="certificate_" />
|
|
|
|
|
+ <result property="cancelCauses" column="cancel_causes" />
|
|
|
|
|
+ <result property="cancelReasons" column="cancel_reasons" />
|
|
|
|
|
+ <result property="cancelImages" column="cancel_images" />
|
|
|
|
|
+ <result property="peopleSeenNum" column="people_seen_num" />
|
|
|
|
|
+ <result property="bak" column="bak_" />
|
|
|
|
|
+ <result property="payCertificate" column="pay_certificate" />
|
|
|
|
|
+
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
|
|
+ select sys_guid() from dual
|
|
|
|
|
+ </selectKey>
|
|
|
|
|
+ -->
|
|
|
|
|
+ <![CDATA[
|
|
|
|
|
+ insert into base_work_order
|
|
|
|
|
+ (id_,number_,title_,address_,date_,tag_,image_,status_,price_,location_,company_id,map_,construction_location,environment,volume_,technician_id,pay_status,create_time,update_time,del_flag,create_by,update_by,
|
|
|
|
|
+ customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images,people_seen_num,bak_,pay_certificate)
|
|
|
|
|
+ values
|
|
|
|
|
+ (
|
|
|
|
|
+#{id,jdbcType=VARCHAR}
|
|
|
|
|
+,#{number,jdbcType=VARCHAR}
|
|
|
|
|
+,#{title,jdbcType=VARCHAR}
|
|
|
|
|
+,#{address,jdbcType=VARCHAR}
|
|
|
|
|
+,#{date,jdbcType= TIMESTAMP }
|
|
|
|
|
+,#{tag,jdbcType=VARCHAR}
|
|
|
|
|
+,#{image,jdbcType=VARCHAR}
|
|
|
|
|
+,#{status,jdbcType=VARCHAR}
|
|
|
|
|
+,#{price,jdbcType= NUMERIC }
|
|
|
|
|
+,#{location,jdbcType=VARCHAR}
|
|
|
|
|
+,#{companyId,jdbcType=VARCHAR}
|
|
|
|
|
+,#{map,jdbcType=VARCHAR}
|
|
|
|
|
+,#{constructionLocation,jdbcType=VARCHAR}
|
|
|
|
|
+,#{environment,jdbcType=VARCHAR}
|
|
|
|
|
+,#{volume,jdbcType= NUMERIC }
|
|
|
|
|
+,#{technicianId,jdbcType=VARCHAR}
|
|
|
|
|
+,#{payStatus,jdbcType=VARCHAR}
|
|
|
|
|
+,#{createTime,jdbcType= TIMESTAMP }
|
|
|
|
|
+,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
|
|
+,#{delFlag,jdbcType= NUMERIC }
|
|
|
|
|
+,#{createBy,jdbcType=VARCHAR}
|
|
|
|
|
+,#{updateBy,jdbcType=VARCHAR}
|
|
|
|
|
+,#{customerName,jdbcType=VARCHAR}
|
|
|
|
|
+,#{customerPhone,jdbcType=VARCHAR}
|
|
|
|
|
+,#{viewNum,jdbcType= NUMERIC }
|
|
|
|
|
+,#{certificate,jdbcType=VARCHAR}
|
|
|
|
|
+,#{cancelCauses,jdbcType=VARCHAR}
|
|
|
|
|
+,#{cancelReasons,jdbcType=VARCHAR}
|
|
|
|
|
+,#{cancelImages,jdbcType=VARCHAR}
|
|
|
|
|
+,#{peopleSeenNum,jdbcType= NUMERIC }
|
|
|
|
|
+,#{bak,jdbcType=VARCHAR}
|
|
|
|
|
+,#{payCertificate,jdbcType=VARCHAR}
|
|
|
|
|
+ )
|
|
|
|
|
+ ]]>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
|
|
+ delete from base_work_order where id_=#{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+ <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
|
|
|
|
|
+ update base_work_order
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <if test="number!=null">
|
|
|
|
|
+ number_=#{number,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title!=null">
|
|
|
|
|
+ title_=#{title,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="address!=null">
|
|
|
|
|
+ address_=#{address,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="date!=null">
|
|
|
|
|
+ date_=#{date,jdbcType= TIMESTAMP },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="tag!=null">
|
|
|
|
|
+ tag_=#{tag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="image!=null">
|
|
|
|
|
+ image_=#{image,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="status!=null">
|
|
|
|
|
+ status_=#{status,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="price!=null">
|
|
|
|
|
+ price_=#{price,jdbcType= NUMERIC },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="location!=null">
|
|
|
|
|
+ location_=#{location,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="map!=null">
|
|
|
|
|
+ map_=#{map,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="constructionLocation!=null">
|
|
|
|
|
+ construction_location=#{constructionLocation,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="environment!=null">
|
|
|
|
|
+ environment=#{environment,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="volume!=null">
|
|
|
|
|
+ volume_=#{volume,jdbcType= NUMERIC },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="technicianId!=null">
|
|
|
|
|
+ technician_id=#{technicianId,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="payStatus!=null">
|
|
|
|
|
+ pay_status=#{payStatus,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime!=null">
|
|
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateTime!=null">
|
|
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="delFlag!=null">
|
|
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createBy!=null">
|
|
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="updateBy!=null">
|
|
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="customerName!=null">
|
|
|
|
|
+ customer_name=#{customerName,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="customerPhone!=null">
|
|
|
|
|
+ customer_phone=#{customerPhone,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="viewNum!=null">
|
|
|
|
|
+ view_num=#{viewNum,jdbcType=NUMERIC},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="certificate!=null">
|
|
|
|
|
+ certificate_=#{certificate,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cancelCauses!=null">
|
|
|
|
|
+ cancel_causes=#{cancelCauses,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cancelReasons!=null">
|
|
|
|
|
+ cancel_reasons=#{cancelReasons,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="cancelImages!=null">
|
|
|
|
|
+ cancel_images=#{cancelImages,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="peopleSeenNum!=null">
|
|
|
|
|
+ people_seen_num=#{peopleSeenNum,jdbcType= NUMERIC },
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="bak!=null">
|
|
|
|
|
+ bak_=#{bak,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="payCertificate!=null">
|
|
|
|
|
+ pay_certificate=#{payCertificate,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where id_=#{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <select id="get" parameterType="string" resultMap="WorkOrderMap">
|
|
|
|
|
+ select * from base_work_order where id_=#{0}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
|
|
+ select count(*) from base_work_order where id_=#{0}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="list" resultMap="WorkOrderMap">
|
|
|
|
|
+ select * from base_work_order
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="findLastByCompanyId" resultMap="WorkOrderMap">
|
|
|
|
|
+ select * from base_work_order where del_flag=false and company_id=#{0}
|
|
|
|
|
+ order by create_time desc limit 1
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="countByCustomerId" resultType="java.util.Map">
|
|
|
|
|
+ select count(id_) as 'count_',sum(price_) as 'price_' from base_work_order
|
|
|
|
|
+ <where>
|
|
|
|
|
+ del_flag = false
|
|
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
|
|
+ and company_id = #{searchParams.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.status != null">
|
|
|
|
|
+ and status_ = #{searchParams.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="countByTechnicianId" resultType="java.lang.Integer">
|
|
|
|
|
+ select count(id_) from base_work_order
|
|
|
|
|
+ <where>
|
|
|
|
|
+ del_flag = false
|
|
|
|
|
+ <if test="searchParams.technicianId != null">
|
|
|
|
|
+ and technician_id = #{searchParams.technicianId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.status != null">
|
|
|
|
|
+ and status_ = #{searchParams.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="findTopByCustomerId" resultType="java.lang.String">
|
|
|
|
|
+ select technician_id from base_work_order where del_flag = false and company_id = #{0}
|
|
|
|
|
+ order by create_time desc limit 3
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="WorkOrderMap">
|
|
|
|
|
+ <![CDATA[
|
|
|
|
|
+ select * from base_work_order
|
|
|
|
|
+ ]]>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ del_flag = false
|
|
|
|
|
+ <if test="searchParams.status != null">
|
|
|
|
|
+ and status_ = #{searchParams.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.key != null">
|
|
|
|
|
+ and (title_ like #{searchParams.key} or address_ like #{searchParams.key})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.technicianId != null">
|
|
|
|
|
+ and technician_id = #{searchParams.technicianId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.date != null">
|
|
|
|
|
+ and create_time like #{searchParams.date}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="searchMobile" parameterType="hashmap" resultMap="WorkOrderMap">
|
|
|
|
|
+ <![CDATA[
|
|
|
|
|
+ select * from base_work_order
|
|
|
|
|
+ ]]>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ del_flag = false
|
|
|
|
|
+ <if test="searchParams.title != null">
|
|
|
|
|
+ and title_ like #{searchParams.title}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
|
|
+ and company_id = #{searchParams.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.status != null">
|
|
|
|
|
+ and status_ = #{searchParams.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.startDate != null">
|
|
|
|
|
+ <![CDATA[
|
|
|
|
|
+ and date_ >= #{searchParams.startDate}
|
|
|
|
|
+ ]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchParams.endDate != null">
|
|
|
|
|
+ <![CDATA[
|
|
|
|
|
+ and date_ < #{searchParams.endDate}
|
|
|
|
|
+ ]]>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|