|  | @@ -2,19 +2,19 @@
 | 
												
													
														
															|  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
												
													
														
															|  |  <mapper namespace="com.jeeplus.modules.wexintheorder.dao.TheOrderWebDao">
 |  |  <mapper namespace="com.jeeplus.modules.wexintheorder.dao.TheOrderWebDao">
 | 
												
													
														
															|  |  	<sql id="orderColumns">
 |  |  	<sql id="orderColumns">
 | 
												
													
														
															|  | -		a.id AS "id",
 |  | 
 | 
												
													
														
															|  | -		a.create_by AS "createBy.id",
 |  | 
 | 
												
													
														
															|  | -		a.create_date AS "createDate",
 |  | 
 | 
												
													
														
															|  | -		a.update_by AS "updateBy.id",
 |  | 
 | 
												
													
														
															|  | -		a.update_date AS "updateDate",
 |  | 
 | 
												
													
														
															|  | -		a.remarks AS "remarks",
 |  | 
 | 
												
													
														
															|  | -		a.del_flag AS "delFlag",
 |  | 
 | 
												
													
														
															|  | -		a.name AS "name",
 |  | 
 | 
												
													
														
															|  | -		a.department AS "department",
 |  | 
 | 
												
													
														
															|  | -		a.leadership AS "leadership",
 |  | 
 | 
												
													
														
															|  | -		a.confirmOrder AS "confirmOrder",
 |  | 
 | 
												
													
														
															|  | -		a.scheduled AS "scheduled",
 |  | 
 | 
												
													
														
															|  | -		a.correlationId AS "correlationId"
 |  | 
 | 
												
													
														
															|  | 
 |  | +	  a.id,
 | 
												
													
														
															|  | 
 |  | +	  a.create_by AS "createBy.id",
 | 
												
													
														
															|  | 
 |  | +	  a.create_date AS "createDate",
 | 
												
													
														
															|  | 
 |  | +	  a.update_by AS "updateBy.id",
 | 
												
													
														
															|  | 
 |  | +	  a.update_date AS "updateDate",
 | 
												
													
														
															|  | 
 |  | +	  a.del_flag as "delFlag",
 | 
												
													
														
															|  | 
 |  | +	  a.remarks,
 | 
												
													
														
															|  | 
 |  | +	  a.name,
 | 
												
													
														
															|  | 
 |  | +	  a.team,
 | 
												
													
														
															|  | 
 |  | +	  a.financial,
 | 
												
													
														
															|  | 
 |  | +	  a.specific,
 | 
												
													
														
															|  | 
 |  | +	  a.scheduled,
 | 
												
													
														
															|  | 
 |  | +	  a.correlationId
 | 
												
													
														
															|  |  	</sql>
 |  |  	</sql>
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	<sql id="orderLeftJoinColumns">
 |  |  	<sql id="orderLeftJoinColumns">
 | 
												
											
												
													
														
															|  | @@ -26,6 +26,7 @@
 | 
												
													
														
															|  |  	<select id="get" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder">
 |  |  	<select id="get" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder">
 | 
												
													
														
															|  |  		SELECT
 |  |  		SELECT
 | 
												
													
														
															|  |  		<include refid="orderColumns"/>
 |  |  		<include refid="orderColumns"/>
 | 
												
													
														
															|  | 
 |  | +		,a.department
 | 
												
													
														
															|  |  		FROM the_order a
 |  |  		FROM the_order a
 | 
												
													
														
															|  |  		WHERE a.id = #{id}
 |  |  		WHERE a.id = #{id}
 | 
												
													
														
															|  |  	</select>
 |  |  	</select>
 | 
												
											
												
													
														
															|  | @@ -33,11 +34,12 @@
 | 
												
													
														
															|  |  	<select id="findList" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder" >
 |  |  	<select id="findList" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder" >
 | 
												
													
														
															|  |  		SELECT
 |  |  		SELECT
 | 
												
													
														
															|  |  		<include refid="orderColumns"/>
 |  |  		<include refid="orderColumns"/>
 | 
												
													
														
															|  | 
 |  | +		, concat_ws(" / ",a.department,a.specific) as department
 | 
												
													
														
															|  |  		FROM the_order a
 |  |  		FROM the_order a
 | 
												
													
														
															|  |  		<include refid="orderLeftJoinColumns"/>
 |  |  		<include refid="orderLeftJoinColumns"/>
 | 
												
													
														
															|  |  		<where>
 |  |  		<where>
 | 
												
													
														
															|  |  			a.del_flag = #{DEL_FLAG_NORMAL}
 |  |  			a.del_flag = #{DEL_FLAG_NORMAL}
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 0">
 |  | 
 | 
												
													
														
															|  | 
 |  | +			<if test="orderStatus != null and orderStatus == 0">
 | 
												
													
														
															|  |  				<if test="beginDate !=null">
 |  |  				<if test="beginDate !=null">
 | 
												
													
														
															|  |  					and a.scheduled >= #{beginDate}
 |  |  					and a.scheduled >= #{beginDate}
 | 
												
													
														
															|  |  				</if>
 |  |  				</if>
 | 
												
											
												
													
														
															|  | @@ -45,21 +47,13 @@
 | 
												
													
														
															|  |  					and a.scheduled < #{endDate}
 |  |  					and a.scheduled < #{endDate}
 | 
												
													
														
															|  |  				</if>
 |  |  				</if>
 | 
												
													
														
															|  |  			</if>
 |  |  			</if>
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 1">
 |  | 
 | 
												
													
														
															|  | -				<if test="beginDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder >= #{beginDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -				<if test="endDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder < #{endDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -			</if>
 |  | 
 | 
												
													
														
															|  |  		</where>
 |  |  		</where>
 | 
												
													
														
															|  |  		<choose>
 |  |  		<choose>
 | 
												
													
														
															|  |  			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 |  |  			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 | 
												
													
														
															|  | -				ORDER BY sc.id desc , so.id desc , a.leadership desc, a.create_date asc , ${page.orderBy}
 |  | 
 | 
												
													
														
															|  | 
 |  | +				ORDER BY a.team asc,a.department asc,a.specific asc ,sc.id desc , so.id desc, a.create_date asc , ${page.orderBy}
 | 
												
													
														
															|  |  			</when>
 |  |  			</when>
 | 
												
													
														
															|  |  			<otherwise>
 |  |  			<otherwise>
 | 
												
													
														
															|  | -				ORDER BY sc.id desc , so.id desc, a.leadership desc, a.create_date asc
 |  | 
 | 
												
													
														
															|  | 
 |  | +				ORDER BY a.team asc,a.department asc,a.specific asc ,sc.id desc , so.id desc, a.create_date asc
 | 
												
													
														
															|  |  			</otherwise>
 |  |  			</otherwise>
 | 
												
													
														
															|  |  		</choose>
 |  |  		</choose>
 | 
												
													
														
															|  |  	</select>
 |  |  	</select>
 | 
												
											
												
													
														
															|  | @@ -68,7 +62,7 @@
 | 
												
													
														
															|  |  		SELECT count(DISTINCT a.id)
 |  |  		SELECT count(DISTINCT a.id)
 | 
												
													
														
															|  |  		from the_order a
 |  |  		from the_order a
 | 
												
													
														
															|  |  	  	<where>
 |  |  	  	<where>
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 0">
 |  | 
 | 
												
													
														
															|  | 
 |  | +			<if test="orderStatus != null and orderStatus == 0">
 | 
												
													
														
															|  |  				<if test="beginDate !=null">
 |  |  				<if test="beginDate !=null">
 | 
												
													
														
															|  |  					and a.scheduled >= #{beginDate}
 |  |  					and a.scheduled >= #{beginDate}
 | 
												
													
														
															|  |  				</if>
 |  |  				</if>
 | 
												
											
												
													
														
															|  | @@ -76,36 +70,18 @@
 | 
												
													
														
															|  |  					and a.scheduled < #{endDate}
 |  |  					and a.scheduled < #{endDate}
 | 
												
													
														
															|  |  				</if>
 |  |  				</if>
 | 
												
													
														
															|  |  			</if>
 |  |  			</if>
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 1">
 |  | 
 | 
												
													
														
															|  | -				<if test="beginDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder >= #{beginDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -				<if test="endDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder < #{endDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -			</if>
 |  | 
 | 
												
													
														
															|  |  		</where>
 |  |  		</where>
 | 
												
													
														
															|  |  	</select>
 |  |  	</select>
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  	<!-- 查询分管领导名称 -->
 |  |  	<!-- 查询分管领导名称 -->
 | 
												
													
														
															|  |  	<select id="getLeadershipList" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder">
 |  |  	<select id="getLeadershipList" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder">
 | 
												
													
														
															|  | -		select distinct(a.leadership) as leadership from the_order a
 |  | 
 | 
												
													
														
															|  | 
 |  | +		select distinct(a.department) as department from the_order a
 | 
												
													
														
															|  |  		<where>
 |  |  		<where>
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 0">
 |  | 
 | 
												
													
														
															|  | -				<if test="beginDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.scheduled >= #{beginDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -				<if test="endDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.scheduled < #{endDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | 
 |  | +			<if test="beginDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled >= #{beginDate}
 | 
												
													
														
															|  |  			</if>
 |  |  			</if>
 | 
												
													
														
															|  | -			<if test="orderStatus != null and orderStatus = 1">
 |  | 
 | 
												
													
														
															|  | -				<if test="beginDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder >= #{beginDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | -				<if test="endDate !=null">
 |  | 
 | 
												
													
														
															|  | -					and a.confirmOrder < #{endDate}
 |  | 
 | 
												
													
														
															|  | -				</if>
 |  | 
 | 
												
													
														
															|  | 
 |  | +			<if test="endDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled < #{endDate}
 | 
												
													
														
															|  |  			</if>
 |  |  			</if>
 | 
												
													
														
															|  |  		</where>
 |  |  		</where>
 | 
												
													
														
															|  |  	</select>
 |  |  	</select>
 | 
												
											
												
													
														
															|  | @@ -114,11 +90,39 @@
 | 
												
													
														
															|  |  	select (@rownum :=@rownum + 1) as "serialNumber",theOrder.* from (
 |  |  	select (@rownum :=@rownum + 1) as "serialNumber",theOrder.* from (
 | 
												
													
														
															|  |  		select
 |  |  		select
 | 
												
													
														
															|  |  			<include refid="orderColumns"/>
 |  |  			<include refid="orderColumns"/>
 | 
												
													
														
															|  | 
 |  | +		,a.department
 | 
												
													
														
															|  |  		from the_order a
 |  |  		from the_order a
 | 
												
													
														
															|  |  			<include refid="orderLeftJoinColumns"/>
 |  |  			<include refid="orderLeftJoinColumns"/>
 | 
												
													
														
															|  | -		where a.leadership=#{leadership}
 |  | 
 | 
												
													
														
															|  | 
 |  | +		<where>
 | 
												
													
														
															|  | 
 |  | +			a.department=#{department}
 | 
												
													
														
															|  | 
 |  | +			<if test="beginDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled >= #{beginDate}
 | 
												
													
														
															|  | 
 |  | +			</if>
 | 
												
													
														
															|  | 
 |  | +			<if test="endDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled < #{endDate}
 | 
												
													
														
															|  | 
 |  | +			</if>
 | 
												
													
														
															|  | 
 |  | +		</where>
 | 
												
													
														
															|  |  		order by sc.id desc ,so.id desc,a.create_date asc) as theOrder ,(select @rownum := 0) temp
 |  |  		order by sc.id desc ,so.id desc,a.create_date asc) as theOrder ,(select @rownum := 0) temp
 | 
												
													
														
															|  |  	</select>
 |  |  	</select>
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +	<select id="getTheOrderListCountByDepartment" resultType="com.jeeplus.modules.wexintheorder.entity.TheOrder">
 | 
												
													
														
															|  | 
 |  | +		select (@rownum :=@rownum + 1) as "serialNumber",theOrder.* from (
 | 
												
													
														
															|  | 
 |  | +		select
 | 
												
													
														
															|  | 
 |  | +		<include refid="orderColumns"/>
 | 
												
													
														
															|  | 
 |  | +		, concat_ws(" / ",a.department,a.specific) as department,count(1) as `number`
 | 
												
													
														
															|  | 
 |  | +		from the_order a
 | 
												
													
														
															|  | 
 |  | +		<include refid="orderLeftJoinColumns"/>
 | 
												
													
														
															|  | 
 |  | +		<where>
 | 
												
													
														
															|  | 
 |  | +			<if test="beginDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled >= #{beginDate}
 | 
												
													
														
															|  | 
 |  | +			</if>
 | 
												
													
														
															|  | 
 |  | +			<if test="endDate !=null">
 | 
												
													
														
															|  | 
 |  | +				and a.scheduled < #{endDate}
 | 
												
													
														
															|  | 
 |  | +			</if>
 | 
												
													
														
															|  | 
 |  | +		</where>
 | 
												
													
														
															|  | 
 |  | +		group by a.specific
 | 
												
													
														
															|  | 
 |  | +		order by a.specific desc,a.team asc,a.department asc,sc.id desc ,so.id desc,a.create_date asc) as theOrder ,(select @rownum := 0) temp
 | 
												
													
														
															|  | 
 |  | +	</select>
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  </mapper>
 |  |  </mapper>
 |