修改系统
This commit is contained in:
		| @@ -0,0 +1,27 @@ | ||||
| <?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.stdiet.custom.mapper.CusUserPostMapper"> | ||||
|  | ||||
|     <resultMap type="CusUserPost" id="CusUserPostResult"> | ||||
|         <result property="userId" column="user_id"/> | ||||
|         <result property="userName" column="nick_name"/> | ||||
|         <result property="postId" column="post_id"/> | ||||
|         <result property="postCode" column="post_code"/> | ||||
|         <result property="postName" column="post_name"/> | ||||
|         <result property="remark" column="remark"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectCusUserPostVo"> | ||||
|         SELECT u.user_id, u.nick_name, p.post_id, p.post_code, p.post_name, u.remark | ||||
|         FROM sys_user u, sys_post p, sys_user_post up | ||||
|         WHERE up.user_id = u.user_id AND p.post_id = up.post_id AND p.remark = 'sale_post' AND u.status = 0 | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectAllCusUserPost" parameterType="CusUserPost" resultMap="CusUserPostResult"> | ||||
|         <include refid="selectCusUserPostVo"/> | ||||
|     </select> | ||||
|  | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,191 @@ | ||||
| <?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.stdiet.custom.mapper.SysCommisionMapper"> | ||||
|  | ||||
|     <resultMap type="SysCommision" id="SysCommisionResult"> | ||||
|         <result property="ruleId" column="rule_id"/> | ||||
|         <result property="userId" column="user_id"/> | ||||
|         <result property="postId" column="post_id"/> | ||||
|         <result property="userName" column="user_name"/> | ||||
|         <result property="postName" column="post_name"/> | ||||
|         <result property="amount" column="amount"/> | ||||
|         <result property="rate" column="rate"/> | ||||
|         <result property="createBy" column="create_by"/> | ||||
|         <result property="createTime" column="create_time"/> | ||||
|         <result property="updateBy" column="update_by"/> | ||||
|         <result property="updateTime" column="update_time"/> | ||||
|         <result property="remark" column="remark"/> | ||||
|         <result property="commision" column="commision"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <resultMap id="SysCommisionDetailResult" type="SysCommision"> | ||||
|         <result property="userId" column="user_id"/> | ||||
|         <result property="userName" column="user_name"/> | ||||
|         <result property="postId" column="post_id"/> | ||||
|         <result property="postName" column="post_name"/> | ||||
|         <result property="amount" column="amount"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="groupAmountVo"> | ||||
|         SELECT ${column} AS user_id, ${postId} AS post_id, SUM(amount) AS amount | ||||
|         FROM sys_order | ||||
|         WHERE ${column} IS NOT NULL AND ${column} <> 0 | ||||
|         AND review_status = 'yes' | ||||
|         <if test="beginTime != null and beginTime != ''">AND date_format(order_time,'%y%m%d') >= | ||||
|             date_format(${beginTime},'%y%m%d') | ||||
|         </if> | ||||
|         <if test="endTime != null and endTime != ''">AND date_format(order_time,'%y%m%d') <= | ||||
|             date_format(${endTime},'%y%m%d') | ||||
|         </if> | ||||
|         GROUP BY ${column} | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysCommisionDetail" parameterType="SysCommision" resultMap="SysCommisionResult"> | ||||
|         SELECT * FROM view_user_post pa | ||||
|         JOIN ( | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="pre_sale_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="5"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="after_sale_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="6"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="nutritionist_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="9"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="nutri_assis_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="10"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="operator_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="11"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="operator_assis_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="13"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="planner_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="7"/> | ||||
|         </include> | ||||
|         UNION | ||||
|         <include refid="groupAmountVo"> | ||||
|             <property name="column" value="planner_assis_id"/> | ||||
|             <property name="beginTime" value="#{beginTime}"/> | ||||
|             <property name="endTime" value="#{endTime}"/> | ||||
|             <property name="postId" value="8"/> | ||||
|         </include> | ||||
|         ) AS a USING(user_id, post_id) | ||||
|         <where> | ||||
|             <if test="postId != null and postId != ''">and post_id = #{postId}</if> | ||||
|             <if test="userId != null and userId != ''">and user_id = #{userId}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
|     <sql id="selectSysCommisionVo"> | ||||
|         SELECT * FROM ( | ||||
|         SELECT * FROM sys_commision c | ||||
|         JOIN (SELECT user_id, nick_name AS user_name FROM sys_user) AS u USING(user_id) | ||||
|         JOIN (SELECT post_id, post_name FROM sys_post) AS p USING(post_id) | ||||
|         <if test="postId != null">WHERE post_id = ${postId}</if> | ||||
|         ORDER BY user_id, amount | ||||
|         ) as t | ||||
|     </sql> | ||||
|  | ||||
|  | ||||
|     <select id="selectSysCommisionList" parameterType="SysCommision" resultMap="SysCommisionResult"> | ||||
|         <include refid="selectSysCommisionVo"> | ||||
|             <property name="postId" value="#{postId}"/> | ||||
|         </include> | ||||
|         <where> | ||||
|             <if test="userId != null ">and user_id = #{userId}</if> | ||||
|             <if test="postId != null ">and post_id = #{postId}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysCommisionById" parameterType="SysCommision" resultMap="SysCommisionResult"> | ||||
|         <include refid="selectSysCommisionVo"> | ||||
|             <property name="postId" value="#{postId}"/> | ||||
|         </include> | ||||
|         where rule_id = #{ruleId} | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSysCommision" parameterType="SysCommision" useGeneratedKeys="true" keyProperty="ruleId"> | ||||
|         insert into sys_commision | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="userId != null">user_id,</if> | ||||
|             <if test="postId != null">post_id,</if> | ||||
|             <if test="amount != null">amount,</if> | ||||
|             <if test="rate != null">rate,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="remark != null">remark,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="userId != null">#{userId},</if> | ||||
|             <if test="postId != null">#{postId},</if> | ||||
|             <if test="amount != null">#{amount},</if> | ||||
|             <if test="rate != null">#{rate},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="remark != null">#{remark},</if> | ||||
|         </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSysCommision" parameterType="SysCommision"> | ||||
|         update sys_commision | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="userId != null">user_id = #{userId},</if> | ||||
|             <if test="postId != null">post_id = #{postId},</if> | ||||
|             <if test="amount != null">amount = #{amount},</if> | ||||
|             <if test="rate != null">rate = #{rate},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="remark != null">remark = #{remark},</if> | ||||
|         </trim> | ||||
|         where rule_id = #{ruleId} | ||||
|     </update> | ||||
|  | ||||
|     <delete id="deleteSysCommisionById" parameterType="Long"> | ||||
|         delete from sys_commision where rule_id = #{ruleId} | ||||
|     </delete> | ||||
|  | ||||
|     <delete id="deleteSysCommisionByIds" parameterType="String"> | ||||
|         delete from sys_commision where rule_id in | ||||
|         <foreach item="ruleId" collection="array" open="(" separator="," close=")"> | ||||
|             #{ruleId} | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,120 @@ | ||||
| <?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.stdiet.custom.mapper.SysContractMapper"> | ||||
|  | ||||
|     <resultMap type="SysContract" id="SysContractResult"> | ||||
|         <result property="id" column="id"/> | ||||
|         <result property="status" column="status"/> | ||||
|         <result property="name" column="name"/> | ||||
|         <result property="signName" column="sign_name"/> | ||||
|         <result property="cusId" column="cus_id"/> | ||||
|         <result property="phone" column="phone"/> | ||||
|         <result property="tutor" column="tutor"/> | ||||
|         <result property="serveTime" column="serve_time"/> | ||||
|         <result property="servePromise" column="serve_promise"/> | ||||
|         <result property="amount" column="amount"/> | ||||
|         <result property="path" column="path"/> | ||||
|         <result property="createBy" column="create_by"/> | ||||
|         <result property="createTime" column="create_time"/> | ||||
|         <result property="updateBy" column="update_by"/> | ||||
|         <result property="updateTime" column="update_time"/> | ||||
|         <result property="remark" column="remark"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysContractVo"> | ||||
|         select id, status, name, sign_name, phone, cus_id, serve_time, tutor, serve_promise, amount, path, create_by, create_time, update_by, update_time, remark from sys_contract | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSysContractList" parameterType="SysContract" resultMap="SysContractResult"> | ||||
|         <include refid="selectSysContractVo"/> | ||||
|         <where> | ||||
|             <if test="id != null ">and id = #{id}</if> | ||||
|             <if test="status != null ">and status = #{status}</if> | ||||
|             <if test="tutor != null and tutor != '' ">and tutor = #{tutor}</if> | ||||
|             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if> | ||||
|             <if test="phone != null  and phone != ''">and phone = #{phone}</if> | ||||
|         </where> | ||||
|         order by create_time desc | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysContractById" parameterType="Long" resultMap="SysContractResult"> | ||||
|         <include refid="selectSysContractVo"/> | ||||
|         where id = #{id} | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSysContract" parameterType="SysContract" useGeneratedKeys="true" keyProperty="id"> | ||||
|         insert into sys_contract | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="id != null">id,</if> | ||||
|             <if test="status != null">status,</if> | ||||
|             <if test="name != null and name != ''">name,</if> | ||||
|             <if test="signName != null and signName != ''">sign_name,</if> | ||||
|             <if test="tutor != null and tutor != ''">tutor,</if> | ||||
|             <if test="cusId != null and cusId != ''">cus_id,</if> | ||||
|             <if test="phone != null">phone,</if> | ||||
|             <if test="serveTime != null">serve_time,</if> | ||||
|             <if test="servePromise != null">serve_promise,</if> | ||||
|             <if test="amount != null">amount,</if> | ||||
|             <if test="path != null">path,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="remark != null">remark,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="id != null">#{id},</if> | ||||
|             <if test="status != null">#{status},</if> | ||||
|             <if test="name != null and name != ''">#{name},</if> | ||||
|             <if test="signName != null and signName != ''">#{signName},</if> | ||||
|             <if test="tutor != null and name != ''">#{tutor},</if> | ||||
|             <if test="cusId != null and cusId != ''">#{cusId},</if> | ||||
|             <if test="phone != null">#{phone},</if> | ||||
|             <if test="serveTime != null">#{serveTime},</if> | ||||
|             <if test="servePromise != null">#{servePromise},</if> | ||||
|             <if test="amount != null">#{amount},</if> | ||||
|             <if test="path != null">#{path},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="remark != null">#{remark},</if> | ||||
|         </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSysContract" parameterType="SysContract"> | ||||
|         update sys_contract | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="status != null">status = #{status},</if> | ||||
|             <if test="name != null and name != ''">name = #{name},</if> | ||||
|             <if test="signName != null and signName != ''">sign_name = #{signName},</if> | ||||
|             <if test="tutor != null">tutor = #{tutor},</if> | ||||
|             <if test="cusId != null and cusId != ''">cus_id = #{cusId},</if> | ||||
|             <if test="phone != null">phone = #{phone},</if> | ||||
|             <if test="serveTime != null">serve_time = #{serveTime},</if> | ||||
|             <if test="servePromise != null">serve_promise = #{servePromise},</if> | ||||
|             <if test="amount != null">amount = #{amount},</if> | ||||
|             <if test="path != null">path = #{path},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="remark != null">remark = #{remark},</if> | ||||
|         </trim> | ||||
|         where id = #{id} | ||||
|     </update> | ||||
|  | ||||
|     <delete id="deleteSysContractById" parameterType="Long"> | ||||
|         delete from sys_contract where id = #{id} | ||||
|     </delete> | ||||
|  | ||||
|     <delete id="deleteSysContractByIds" parameterType="String"> | ||||
|         delete from sys_contract where id in | ||||
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | ||||
|             #{id} | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
| </mapper> | ||||
| @@ -0,0 +1,191 @@ | ||||
| <?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.stdiet.custom.mapper.SysOrderMapper"> | ||||
|  | ||||
|     <resultMap type="SysOrder" id="SysOrderResult"> | ||||
|         <result property="orderId" column="order_id"/> | ||||
|         <result property="customer" column="customer"/> | ||||
|         <result property="phone" column="phone"/> | ||||
|         <result property="amount" column="amount"/> | ||||
|         <result property="payTypeId" column="pay_type_id"/> | ||||
|         <result property="payType" column="pay_type"/> | ||||
|         <result property="preSaleId" column="pre_sale_id"/> | ||||
|         <result property="createBy" column="create_by"/> | ||||
|         <result property="createTime" column="create_time"/> | ||||
|         <result property="afterSaleId" column="after_sale_id"/> | ||||
|         <result property="updateBy" column="update_by"/> | ||||
|         <result property="updateTime" column="update_time"/> | ||||
|         <result property="nutritionistId" column="nutritionist_id"/> | ||||
|         <result property="remark" column="remark"/> | ||||
|         <result property="nutriAssisId" column="nutri_assis_id"/> | ||||
|         <result property="accountId" column="account_id"/> | ||||
|         <result property="account" column="account"/> | ||||
|         <result property="plannerId" column="planner_id"/> | ||||
|         <result property="plannerAssisId" column="planner_assis_id"/> | ||||
|         <result property="operatorId" column="operator_id"/> | ||||
|         <result property="operatorAssisId" column="operator_assis_id"/> | ||||
|         <result property="recommender" column="recommender"/> | ||||
|         <result property="orderTime" column="order_time"/> | ||||
|         <result property="serveTime" column="serve_time"/> | ||||
|         <result property="serveTimeId" column="serve_time_id"/> | ||||
|         <result property="reviewStatus" column="review_status"/> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSysOrderVo"> | ||||
|         select o.order_id, o.review_status, o.customer, o.phone, o.amount, ser.dict_label as serve_time, o.serve_time_id, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.operator_assis_id, o.recommender, o.order_time from sys_order o | ||||
|         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id | ||||
|         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = o.account_id | ||||
|         LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_serve_time') AS ser ON ser.dict_value = o.serve_time_id | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectAllOrderAmount" parameterType="SysOrder" resultType="BigDecimal"> | ||||
|         SELECT SUM(amount) FROM sys_order | ||||
|         <where> | ||||
|             <if test="orderId != null  and orderId != ''">and order_id = #{orderId}</if> | ||||
|             <if test="customer != null  and customer != ''">and customer = #{customer}</if> | ||||
|             <if test="phone != null  and phone != ''">and phone = #{phone}</if> | ||||
|             <if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if> | ||||
|             <if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if> | ||||
|             <if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if> | ||||
|             <if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if> | ||||
|             <if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if> | ||||
|             <if test="accountId != null ">and account_id = #{accountId}</if> | ||||
|             <if test="plannerId != null ">and planner_id = #{plannerId}</if> | ||||
|             <if test="plannerAssisId != null ">and planner_assis_id = #{plannerAssisId}</if> | ||||
|             <if test="operatorId != null ">and operator_id = #{operatorId}</if> | ||||
|             <if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if> | ||||
|             <if test="recommender != null  and recommender != ''">and recommender = #{recommender}</if> | ||||
|             <if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if> | ||||
|             <if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if> | ||||
|             <if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if> | ||||
|             <if test="reviewStatus != null ">and review_status = #{reviewStatus}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult"> | ||||
|         <include refid="selectSysOrderVo"/> | ||||
|         <where> | ||||
|             <if test="orderId != null  and orderId != ''">and order_id = #{orderId}</if> | ||||
|             <if test="customer != null  and customer != ''">and customer = #{customer}</if> | ||||
|             <if test="phone != null  and phone != ''">and phone = #{phone}</if> | ||||
|             <if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if> | ||||
|             <if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if> | ||||
|             <if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if> | ||||
|             <if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if> | ||||
|             <if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if> | ||||
|             <if test="accountId != null ">and account_id = #{accountId}</if> | ||||
|             <if test="plannerId != null ">and planner_id = #{plannerId}</if> | ||||
|             <if test="plannerAssisId != null ">and planner_assis_id = #{plannerAssisId}</if> | ||||
|             <if test="operatorId != null ">and operator_id = #{operatorId}</if> | ||||
|             <if test="operatorAssisId != null ">and operator_assis_id = #{operatorAssisId}</if> | ||||
|             <if test="recommender != null  and recommender != ''">and recommender = #{recommender}</if> | ||||
|             <if test="beginTime != null and beginTime != ''">and date_format(order_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')</if> | ||||
|             <if test="endTime != null and endTime != ''">and date_format(order_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')</if> | ||||
|             <if test="serveTimeId != null ">and serve_time_id = #{serveTimeId}</if> | ||||
|             <if test="reviewStatus != null ">and review_status = #{reviewStatus}</if> | ||||
|         </where> | ||||
|         order by order_time desc | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult"> | ||||
|         <include refid="selectSysOrderVo"/> | ||||
|         where order_id = #{orderId} | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSysOrder" parameterType="SysOrder" useGeneratedKeys="true" keyProperty="orderId"> | ||||
|         insert into sys_order | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="orderId != null and orderId != ''">order_id,</if> | ||||
|             <if test="customer != null and customer != ''">customer,</if> | ||||
|             <if test="phone != null">phone,</if> | ||||
|             <if test="amount != null">amount,</if> | ||||
|             <if test="payTypeId != null">pay_type_id,</if> | ||||
|             <if test="preSaleId != null">pre_sale_id,</if> | ||||
|             <if test="createBy != null">create_by,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="afterSaleId != null">after_sale_id,</if> | ||||
|             <if test="updateBy != null">update_by,</if> | ||||
|             <if test="updateTime != null">update_time,</if> | ||||
|             <if test="nutritionistId != null">nutritionist_id,</if> | ||||
|             <if test="remark != null">remark,</if> | ||||
|             <if test="nutriAssisId != null">nutri_assis_id,</if> | ||||
|             <if test="accountId != null">account_id,</if> | ||||
|             <if test="plannerId != null">planner_id,</if> | ||||
|             <if test="plannerAssisId != null">planner_assis_id,</if> | ||||
|             <if test="operatorId != null">operator_id,</if> | ||||
|             <if test="operatorAssisId != null">operator_assis_id,</if> | ||||
|             <if test="recommender != null">recommender,</if> | ||||
|             <if test="orderTime != null">order_time,</if> | ||||
|             <if test="serveTimeId != null">serve_time_id,</if> | ||||
|             <if test="reviewStatus != null">review_status,</if> | ||||
|         </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="orderId != null and orderId != ''">#{orderId},</if> | ||||
|             <if test="customer != null and customer != ''">#{customer},</if> | ||||
|             <if test="phone != null">#{phone},</if> | ||||
|             <if test="amount != null">#{amount},</if> | ||||
|             <if test="payTypeId != null">#{payTypeId},</if> | ||||
|             <if test="preSaleId != null">#{preSaleId},</if> | ||||
|             <if test="createBy != null">#{createBy},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="afterSaleId != null">#{afterSaleId},</if> | ||||
|             <if test="updateBy != null">#{updateBy},</if> | ||||
|             <if test="updateTime != null">#{updateTime},</if> | ||||
|             <if test="nutritionistId != null">#{nutritionistId},</if> | ||||
|             <if test="remark != null">#{remark},</if> | ||||
|             <if test="nutriAssisId != null">#{nutriAssisId},</if> | ||||
|             <if test="accountId != null">#{accountId},</if> | ||||
|             <if test="plannerId != null">#{plannerId},</if> | ||||
|             <if test="plannerAssisId != null">#{plannerAssisId},</if> | ||||
|             <if test="operatorId != null">#{operatorId},</if> | ||||
|             <if test="operatorAssisId != null">#{operatorAssisId},</if> | ||||
|             <if test="recommender != null">#{recommender},</if> | ||||
|             <if test="orderTime != null">#{orderTime},</if> | ||||
|             <if test="serveTimeId != null">#{serveTimeId},</if> | ||||
|             <if test="reviewStatus != null">#{reviewStatus},</if> | ||||
|         </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSysOrder" parameterType="SysOrder"> | ||||
|         update sys_order | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="customer != null and customer != ''">customer = #{customer},</if> | ||||
|             <if test="phone != null">phone = #{phone},</if> | ||||
|             <if test="amount != null">amount = #{amount},</if> | ||||
|             <if test="payTypeId != null">pay_type_id = #{payTypeId},</if> | ||||
|             <if test="preSaleId != null">pre_sale_id = #{preSaleId},</if> | ||||
|             <if test="createBy != null">create_by = #{createBy},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             <if test="afterSaleId != null">after_sale_id = #{afterSaleId},</if> | ||||
|             <if test="updateBy != null">update_by = #{updateBy},</if> | ||||
|             <if test="updateTime != null">update_time = #{updateTime},</if> | ||||
|             <if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if> | ||||
|             <if test="remark != null">remark = #{remark},</if> | ||||
|             <if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if> | ||||
|             <if test="accountId != null">account_id = #{accountId},</if> | ||||
|             <if test="plannerId != null">planner_id = #{plannerId},</if> | ||||
|             <if test="plannerAssisId != null">planner_assis_id = #{plannerAssisId},</if> | ||||
|             <if test="operatorId != null">operator_id = #{operatorId},</if> | ||||
|             <if test="operatorAssisId != null">operator_assis_id = #{operatorAssisId},</if> | ||||
|             <if test="recommender != null">recommender = #{recommender},</if> | ||||
|             <if test="orderTime != null">order_time = #{orderTime},</if> | ||||
|             <if test="serveTimeId != null">serve_time_id = #{serveTimeId},</if> | ||||
|             <if test="reviewStatus != null">review_status = #{reviewStatus},</if> | ||||
|         </trim> | ||||
|         where order_id = #{orderId} | ||||
|     </update> | ||||
|  | ||||
|     <delete id="deleteSysOrderById" parameterType="Long"> | ||||
|         delete from sys_order where order_id = #{orderId} | ||||
|     </delete> | ||||
|  | ||||
|     <delete id="deleteSysOrderByIds" parameterType="String"> | ||||
|         delete from sys_order where order_id in | ||||
|         <foreach item="orderId" collection="array" open="(" separator="," close=")"> | ||||
|             #{orderId} | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user