| | |
| | | import com.xzx.gc.user.service.*; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import com.xzx.gc.util.SessionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @ApiImplicitParam(paramType="query", name = "userType", value = "用户类型(1为普通用户,2为回收员,3为代丢员,4入库员,5运营员)", required = true, dataType = "String"), |
| | | @ApiImplicitParam(paramType="query", name = "mobilePhone", value = "手机号", required = true, dataType = "String") |
| | | }) |
| | | // @ApiResponses({@ApiResponse( code = 200, message = "success", response = UserModel.class)}) |
| | | public JsonResult<Map<String, Object>> queryUserApiList(@RequestBody UserModel userModel){ |
| | | Map<String, Object> map = userService.queryCuserForTimeList(userModel); |
| | | return JsonResult.success(map); |
| | |
| | | GROUP BY a.order_id order by a.create_time |
| | | </select> |
| | | |
| | | <!-- <select id="queryCuserOrderCount" resultType="java.util.HashMap">--> |
| | | <!-- SELECT COUNT(*) as count FROM xzx_order_info WHERE create_user_id=#{userId}--> |
| | | <!-- <if test="status != null">--> |
| | | <!-- and order_status in--> |
| | | <!-- <foreach collection="status" index="index" item="id" open="(" separator="," close=")">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | <!-- GROUP BY order_type--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="queryCuserOrderCount" resultType="java.util.HashMap"> |
| | | SELECT |
| | | COUNT(*) as count |
| | | FROM |
| | | ( |
| | | ( |
| | | SELECT |
| | | a.order_id orderId, |
| | | a.order_status STATUS, |
| | | '1' type, |
| | | ifnull(sum(d.money), 0) money, |
| | | '0' score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | e. NAME NAME, |
| | | a.create_time createTime |
| | | FROM |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id |
| | | LEFT JOIN xzx_user_info e ON e.user_id = a.receiver |
| | | WHERE |
| | | a.create_user_id=#{userId} |
| | | GROUP BY |
| | | a.order_id |
| | | ) |
| | | UNION |
| | | ( |
| | | SELECT |
| | | a.id orderId, |
| | | a. STATUS STATUS, |
| | | '2' type, |
| | | '0' money, |
| | | ifnull(sum(d.score), 0) score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | a.username NAME, |
| | | a.CREATED_TIME createTime |
| | | FROM |
| | | xzx_jhy_order a |
| | | LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id |
| | | WHERE |
| | | a.user_id = #{userId} |
| | | GROUP BY |
| | | a.id |
| | | ) |
| | | ) v |
| | | ORDER BY |
| | | createTime DESC |
| | | SELECT COUNT(*) as count FROM xzx_order_info WHERE create_user_id=#{userId} |
| | | <if test="status != null"> |
| | | and order_status in |
| | | <foreach collection="status" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY order_type |
| | | </select> |
| | | |
| | | <!-- <select id="queryCuserOrderCount" resultType="java.util.HashMap">--> |
| | | <!-- SELECT--> |
| | | <!-- COUNT(*) as count--> |
| | | <!-- FROM--> |
| | | <!-- (--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- a.order_id orderId,--> |
| | | <!-- a.order_status STATUS,--> |
| | | <!-- '1' type,--> |
| | | <!-- ifnull(sum(d.money), 0) money,--> |
| | | <!-- '0' score,--> |
| | | <!-- a.address address,--> |
| | | <!-- ifnull(sum(d.weight), 0) weight,--> |
| | | <!-- e. NAME NAME,--> |
| | | <!-- a.create_time createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_order_info a--> |
| | | <!-- LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id--> |
| | | <!-- LEFT JOIN xzx_user_info e ON e.user_id = a.receiver--> |
| | | <!-- WHERE--> |
| | | <!-- a.create_user_id=#{userId}--> |
| | | <!-- GROUP BY--> |
| | | <!-- a.order_id--> |
| | | <!-- )--> |
| | | <!-- UNION--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- a.id orderId,--> |
| | | <!-- a. STATUS STATUS,--> |
| | | <!-- '2' type,--> |
| | | <!-- '0' money,--> |
| | | <!-- ifnull(sum(d.score), 0) score,--> |
| | | <!-- a.address address,--> |
| | | <!-- ifnull(sum(d.weight), 0) weight,--> |
| | | <!-- a.username NAME,--> |
| | | <!-- a.CREATED_TIME createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_jhy_order a--> |
| | | <!-- LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id--> |
| | | <!-- WHERE--> |
| | | <!-- a.user_id = #{userId}--> |
| | | <!-- GROUP BY--> |
| | | <!-- a.id--> |
| | | <!-- )--> |
| | | <!-- ) v--> |
| | | <!-- ORDER BY--> |
| | | <!-- createTime DESC--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="queryPromoterOrderWeightMoney" resultType="com.xzx.gc.model.admin.PromoterModel"> |
| | | SELECT SUM(c.weight) as orderWeightCount, SUM(c.money) as orderMoneyCount |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- <select id="queryCuserOrderFinishList" resultType="java.util.HashMap">--> |
| | | <!-- SELECT a.order_id as orderId,--> |
| | | <!-- sum(d.money) as money,--> |
| | | <!-- a.address as address,--> |
| | | <!-- a.order_type as orderType,--> |
| | | <!-- sum(d.weight) as weight,--> |
| | | <!-- a.create_time as createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_order_info a--> |
| | | <!-- LEFT JOIN xzx_order_item_info d on a.order_id = d.order_id--> |
| | | <!-- WHERE a.create_user_id=#{userId}--> |
| | | <!-- <if test="status != null">--> |
| | | <!-- and a.order_status in--> |
| | | <!-- <foreach collection="status" index="index" item="id" open="(" separator="," close=")">--> |
| | | <!-- #{id}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- GROUP BY a.order_id--> |
| | | <!-- </select>--> |
| | | <select id="queryCuserOrderFinishList" resultType="java.util.HashMap"> |
| | | SELECT |
| | | orderId, |
| | | address, |
| | | status, |
| | | type, |
| | | money, |
| | | score, |
| | | weight, |
| | | name, |
| | | createTime |
| | | SELECT a.order_id as orderId, |
| | | sum(d.money) as money, |
| | | a.address as address, |
| | | a.order_type as orderType, |
| | | sum(d.weight) as weight, |
| | | a.create_time as createTime |
| | | FROM |
| | | ( |
| | | ( |
| | | SELECT |
| | | a.order_id orderId, |
| | | a.order_status STATUS, |
| | | '1' type, |
| | | ifnull(sum(d.money), 0) money, |
| | | '0' score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | e. NAME NAME, |
| | | a.create_time createTime |
| | | FROM |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id |
| | | LEFT JOIN xzx_user_info e ON e.user_id = a.receiver |
| | | WHERE |
| | | a.create_user_id = #{userId} |
| | | GROUP BY |
| | | a.order_id |
| | | ) |
| | | UNION |
| | | ( |
| | | SELECT |
| | | a.id orderId, |
| | | a. STATUS STATUS, |
| | | '2' type, |
| | | '0' money, |
| | | ifnull(sum(d.score), 0) score, |
| | | a.address address, |
| | | ifnull(sum(d.weight), 0) weight, |
| | | a.username NAME, |
| | | a.CREATED_TIME createTime |
| | | FROM |
| | | xzx_jhy_order a |
| | | LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id |
| | | WHERE |
| | | a.user_id = #{userId} |
| | | GROUP BY |
| | | a.id |
| | | ) |
| | | ) v |
| | | ORDER BY |
| | | createTime DESC |
| | | xzx_order_info a |
| | | LEFT JOIN xzx_order_item_info d on a.order_id = d.order_id |
| | | WHERE a.create_user_id=#{userId} |
| | | <if test="status != null"> |
| | | and a.order_status in |
| | | <foreach collection="status" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY a.order_id |
| | | </select> |
| | | <!-- <select id="queryCuserOrderFinishList" resultType="java.util.HashMap">--> |
| | | <!-- SELECT--> |
| | | <!-- orderId,--> |
| | | <!-- address,--> |
| | | <!-- status,--> |
| | | <!-- type,--> |
| | | <!-- money,--> |
| | | <!-- score,--> |
| | | <!-- weight,--> |
| | | <!-- name,--> |
| | | <!-- createTime--> |
| | | <!-- FROM--> |
| | | <!-- (--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- a.order_id orderId,--> |
| | | <!-- a.order_status STATUS,--> |
| | | <!-- '1' type,--> |
| | | <!-- ifnull(sum(d.money), 0) money,--> |
| | | <!-- '0' score,--> |
| | | <!-- a.address address,--> |
| | | <!-- ifnull(sum(d.weight), 0) weight,--> |
| | | <!-- e. NAME NAME,--> |
| | | <!-- a.create_time createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_order_info a--> |
| | | <!-- LEFT JOIN xzx_order_item_info d ON a.order_id = d.order_id--> |
| | | <!-- LEFT JOIN xzx_user_info e ON e.user_id = a.receiver--> |
| | | <!-- WHERE--> |
| | | <!-- a.create_user_id = #{userId}--> |
| | | <!-- GROUP BY--> |
| | | <!-- a.order_id--> |
| | | <!-- )--> |
| | | <!-- UNION--> |
| | | <!-- (--> |
| | | <!-- SELECT--> |
| | | <!-- a.id orderId,--> |
| | | <!-- a. STATUS STATUS,--> |
| | | <!-- '2' type,--> |
| | | <!-- '0' money,--> |
| | | <!-- ifnull(sum(d.score), 0) score,--> |
| | | <!-- a.address address,--> |
| | | <!-- ifnull(sum(d.weight), 0) weight,--> |
| | | <!-- a.username NAME,--> |
| | | <!-- a.CREATED_TIME createTime--> |
| | | <!-- FROM--> |
| | | <!-- xzx_jhy_order a--> |
| | | <!-- LEFT JOIN xzx_jhy_order_items d ON a.id = d.order_id--> |
| | | <!-- WHERE--> |
| | | <!-- a.user_id = #{userId}--> |
| | | <!-- GROUP BY--> |
| | | <!-- a.id--> |
| | | <!-- )--> |
| | | <!-- ) v--> |
| | | <!-- ORDER BY--> |
| | | <!-- createTime DESC--> |
| | | |
| | | <!-- </select>--> |
| | | |
| | | |
| | | <select id="orderCountStat" parameterType="java.util.Map" resultType="String"> |