|
|
@@ -0,0 +1,305 @@
|
|
|
+<?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.goafanti.common.dao.UserServiceMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserService">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
|
+ <result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
+ <result column="add_wechat" jdbcType="INTEGER" property="addWechat" />
|
|
|
+ <result column="wechat" jdbcType="VARCHAR" property="wechat" />
|
|
|
+ <result column="renewal" jdbcType="INTEGER" property="renewal" />
|
|
|
+ <result column="renewal_time" jdbcType="TIMESTAMP" property="renewalTime" />
|
|
|
+ <result column="sign_project" jdbcType="VARCHAR" property="signProject" />
|
|
|
+ <result column="sign_project_id" jdbcType="VARCHAR" property="signProjectId" />
|
|
|
+ <result column="new_time" jdbcType="TIMESTAMP" property="newTime" />
|
|
|
+ <result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ id, `uid`, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
|
|
|
+ new_time, remarks, create_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from user_service
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ delete from user_service
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.UserService">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ insert into user_service (id, `uid`, aid,
|
|
|
+ add_wechat, wechat, renewal,
|
|
|
+ renewal_time, sign_project, sign_project_id,
|
|
|
+ new_time, remarks, create_time
|
|
|
+ )
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
|
|
|
+ #{addWechat,jdbcType=INTEGER}, #{wechat,jdbcType=VARCHAR}, #{renewal,jdbcType=INTEGER},
|
|
|
+ #{renewalTime,jdbcType=TIMESTAMP}, #{signProject,jdbcType=VARCHAR}, #{signProjectId,jdbcType=VARCHAR},
|
|
|
+ #{newTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.UserService">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ insert into user_service
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ `uid`,
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid,
|
|
|
+ </if>
|
|
|
+ <if test="addWechat != null">
|
|
|
+ add_wechat,
|
|
|
+ </if>
|
|
|
+ <if test="wechat != null">
|
|
|
+ wechat,
|
|
|
+ </if>
|
|
|
+ <if test="renewal != null">
|
|
|
+ renewal,
|
|
|
+ </if>
|
|
|
+ <if test="renewalTime != null">
|
|
|
+ renewal_time,
|
|
|
+ </if>
|
|
|
+ <if test="signProject != null">
|
|
|
+ sign_project,
|
|
|
+ </if>
|
|
|
+ <if test="signProjectId != null">
|
|
|
+ sign_project_id,
|
|
|
+ </if>
|
|
|
+ <if test="newTime != null">
|
|
|
+ new_time,
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="uid != null">
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addWechat != null">
|
|
|
+ #{addWechat,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="wechat != null">
|
|
|
+ #{wechat,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="renewal != null">
|
|
|
+ #{renewal,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="renewalTime != null">
|
|
|
+ #{renewalTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="signProject != null">
|
|
|
+ #{signProject,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="signProjectId != null">
|
|
|
+ #{signProjectId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="newTime != null">
|
|
|
+ #{newTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ #{remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserService">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ update user_service
|
|
|
+ <set>
|
|
|
+ <if test="uid != null">
|
|
|
+ `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addWechat != null">
|
|
|
+ add_wechat = #{addWechat,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="wechat != null">
|
|
|
+ wechat = #{wechat,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="renewal != null">
|
|
|
+ renewal = #{renewal,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="renewalTime != null">
|
|
|
+ renewal_time = #{renewalTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="signProject != null">
|
|
|
+ sign_project = #{signProject,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="signProjectId != null">
|
|
|
+ sign_project_id = #{signProjectId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="newTime != null">
|
|
|
+ new_time = #{newTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserService">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Tue May 18 15:33:59 CST 2021.
|
|
|
+ -->
|
|
|
+ update user_service
|
|
|
+ set `uid` = #{uid,jdbcType=VARCHAR},
|
|
|
+ aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ add_wechat = #{addWechat,jdbcType=INTEGER},
|
|
|
+ wechat = #{wechat,jdbcType=VARCHAR},
|
|
|
+ renewal = #{renewal,jdbcType=INTEGER},
|
|
|
+ renewal_time = #{renewalTime,jdbcType=TIMESTAMP},
|
|
|
+ sign_project = #{signProject,jdbcType=VARCHAR},
|
|
|
+ sign_project_id = #{signProjectId,jdbcType=VARCHAR},
|
|
|
+ new_time = #{newTime,jdbcType=TIMESTAMP},
|
|
|
+ remarks = #{remarks,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <select id="selectByUid" resultType="java.lang.Integer">
|
|
|
+ select id from user_service where uid= #{uid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <resultMap id="userService" type="com.goafanti.user.bo.OutOrderUserService">
|
|
|
+ <result property="orderNo" column="orderNo"/>
|
|
|
+ <result property="contractNo" column="contractNo"/>
|
|
|
+ <result property="depName" column="depName"/>
|
|
|
+ <result property="userName" column="userName"/>
|
|
|
+ <result property="signTimes" column="signTimes"/>
|
|
|
+ <result property="newTimes" column="newTimes"/>
|
|
|
+ <result property="adminName" column="adminName"/>
|
|
|
+ <result property="addWechat" column="addWechat"/>
|
|
|
+ <result property="wechat" column="wechat"/>
|
|
|
+ <result property="renewal" column="renewal"/>
|
|
|
+ <result property="signProject" column="signProject"/>
|
|
|
+ <result property="remarks" column="remarks"/>
|
|
|
+ <result property="renewalTimes" column="renewalTimes"/>
|
|
|
+ <collection property="list" javaType="java.util.ArrayList" ofType="com.goafanti.user.bo.OrderProject">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="commodityName" column="commodityName"/>
|
|
|
+ <result property="receiverName" column="receiverName"/>
|
|
|
+ <result property="declarationBatch" column="declarationBatch"/>
|
|
|
+ <result property="certificateNumber" column="certificateNumber"/>
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="OrderUseServiceList" resultMap="userService">
|
|
|
+ select a.order_no orderNo,a.contract_no contractNo,b.dep_name depName ,a.create_time ,b.buyer_name userName,c.new_time ,
|
|
|
+date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as signTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes,
|
|
|
+date_format(c.renewal_time,'%Y-%m-%d') as renewalTimes,d.name adminName,c.add_wechat addWechat,c.wechat ,c.renewal ,
|
|
|
+c.renewal_time ,c.sign_project signProject ,c.remarks ,e.certificate_number certificateNumber,e.id,
|
|
|
+e.commodity_name commodityName,e.receiver_name receiverName, e.declaration_batch declarationBatch
|
|
|
+from t_order_new a
|
|
|
+left join t_order_mid b on a.order_no =b.order_no left join user_service c on a.buyer_id =c.uid
|
|
|
+left join admin d on c.aid =d.id left join t_order_task e on a.order_no=e.order_no
|
|
|
+where 1=1
|
|
|
+<if test="userName != null">
|
|
|
+and b.buyer_name like CONCAT('%', #{userName},'%')
|
|
|
+</if>
|
|
|
+<if test="depId != null">
|
|
|
+and a.order_dep = #{depId}
|
|
|
+</if>
|
|
|
+<if test="addWechat != null">
|
|
|
+and c.add_wechat = #{addWechat}
|
|
|
+</if>
|
|
|
+<if test="renewal != null">
|
|
|
+and c.renewal = #{renewal}
|
|
|
+</if>
|
|
|
+<if test="startFollowTimes != null">
|
|
|
+and c.new_time BETWEEN #{startFollowTimes} and #{endFollowTimes}
|
|
|
+</if>
|
|
|
+<if test="startSignTimes != null">
|
|
|
+and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
|
|
|
+</if>
|
|
|
+order by c.new_time
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="OrderUseServiceCount" resultType="java.lang.Integer">
|
|
|
+ select count(*)
|
|
|
+from t_order_new a
|
|
|
+left join t_order_mid b on a.order_no =b.order_no left join user_service c on a.buyer_id =c.uid
|
|
|
+left join admin d on c.aid =d.id
|
|
|
+where 1=1
|
|
|
+<if test="userName != null">
|
|
|
+and b.buyer_name like CONCAT('%', #{userName},'%')
|
|
|
+</if>
|
|
|
+<if test="depId != null">
|
|
|
+and a.order_dep = #{depId}
|
|
|
+</if>
|
|
|
+<if test="addWechat != null">
|
|
|
+and c.add_wechat = #{addWechat}
|
|
|
+</if>
|
|
|
+<if test="renewal != null">
|
|
|
+and c.renewal = #{renewal}
|
|
|
+</if>
|
|
|
+<if test="startFollowTimes != null">
|
|
|
+and c.new_time BETWEEN #{startFollowTimes} and #{endFollowTimes}
|
|
|
+</if>
|
|
|
+<if test="startSignTimes != null">
|
|
|
+and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
|
|
|
+</if>
|
|
|
+ </select>
|
|
|
+</mapper>
|