Browse Source

成果需求订单查询修改

albertshaw 8 years ago
parent
commit
1e39affa8f

+ 10 - 18
src/main/java/com/goafanti/common/mapper/AchievementOrderMapperExt.xml

@@ -59,15 +59,14 @@
   		ao.payment_value as paymentValue, ao.payment_type as paymentType, ao.payment_id as paymentId,
   		ao.payment_time as paymentTime, a.name, a.serial_number as achievementSerialNumber,
   		a.deleted_sign as deletedSign, a.audit_status as auditStatus, ui.username,
-  		ao.uid, oi.unit_name as unitName, a.bargaining_mode as bargainingMode,
+  		ao.uid, a.bargaining_mode as bargainingMode,
   		a.transfer_price as transferPrice
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
   	left join user_identity ui on ui.uid = ao.uid
-  	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
-  	and   a.owner_type= 0
+  	and  ui.username is not null
   	<if test="techBrokerId != null">
   		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -78,8 +77,7 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
-  		or ui.username = #{username,jdbcType=VARCHAR})
+  		and ui.username = #{username,jdbcType=VARCHAR}
   	</if>
   	order by ao.serial_number desc
   	<if test="page_sql!=null">
@@ -93,10 +91,9 @@
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
   	left join user_identity ui on ui.uid = ao.uid
-  	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
-  	and   a.owner_type= 0
+  	and  ui.username is not null
   	<if test="techBrokerId != null">
   		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -107,8 +104,7 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
-  		or ui.username = #{username,jdbcType=VARCHAR})
+  		and ui.username = #{username,jdbcType=VARCHAR}
   	</if>
   </select>
   
@@ -120,15 +116,14 @@
   		ao.payment_value as paymentValue, ao.payment_type as paymentType, ao.payment_id as paymentId,
   		ao.payment_time as paymentTime,  a.name, a.serial_number as achievementSerialNumber,
   		a.deleted_sign as deletedSign, a.audit_status as auditStatus, ao.uid,
-  		oi.unit_name as unitName, ui.username, a.bargaining_mode as bargainingMode,
+  		oi.unit_name as unitName, a.bargaining_mode as bargainingMode,
   		a.transfer_price as transferPrice
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
-  	left join user_identity ui on ui.uid = ao.uid
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
-  	and   a.owner_type= 1
+  	and  oi.unit_name is not null
   	<if test="techBrokerId != null">
   		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -139,8 +134,7 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
-  		or ui.username = #{unitName,jdbcType=VARCHAR})
+  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   	order by ao.serial_number desc
   	<if test="page_sql!=null">
@@ -153,11 +147,10 @@
   		count(1)
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
-  	left join user_identity ui on ui.uid = ao.uid
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
-  	and   a.owner_type= 1
+  	and  oi.unit_name is not null
   	<if test="techBrokerId != null">
   		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -168,8 +161,7 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
-  		or ui.username = #{unitName,jdbcType=VARCHAR})
+  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   </select>
 </mapper>

+ 10 - 18
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -244,14 +244,13 @@
   		do.intention_money as intentionMoney, do.contract_money as contractMoney, do.commission,
   		do.service_money as serviceMoney, d.name, d.serial_number as demandSerialNumber,
   		d.deleted_sign as deletedSign, d.audit_status as auditStatus,
-  		do.uid, ui.username, oi.unit_name as unitName
+  		do.uid, ui.username
   	from demand_order do
   	left join demand d on d.id = do.demand_id
   	left join user_identity ui on ui.uid = do.uid
-  	left join organization_identity oi on oi.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
-  	and   d.data_category = 0
+  	and  ui.username is not null
   	<if test="techBrokerId != null">
   		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -262,8 +261,7 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
-  		or ui.username = #{username,jdbcType=VARCHAR})
+  		and ui.username = #{username,jdbcType=VARCHAR}
   	</if>
   	order by do.serial_number desc
   	<if test="page_sql!=null">
@@ -277,10 +275,9 @@
   	from demand_order do
   	left join demand d on d.id = do.demand_id
   	left join user_identity ui on ui.uid = do.uid
-  	left join organization_identity oi on oi.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
-  	and   d.data_category = 0
+  	and  ui.username is not null
   	<if test="techBrokerId != null">
   		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -291,8 +288,7 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
-  		or ui.username = #{username,jdbcType=VARCHAR})
+  		and ui.username = #{username,jdbcType=VARCHAR}
   	</if>
   </select>
   
@@ -304,14 +300,13 @@
   		do.intention_money as intentionMoney, do.contract_money as contractMoney, do.commission,
   		do.service_money as serviceMoney, d.name, d.serial_number as demandSerialNumber,
   		d.deleted_sign as deletedSign, d.audit_status as auditStatus,
-  		do.uid, oi.unit_name as unitName, ui.username
+  		do.uid, oi.unit_name as unitName
   	from demand_order do
   	left join demand d on d.id = do.demand_id
   	left join organization_identity oi on oi.uid = do.uid
-  	left join user_identity ui on ui.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
-  	and   d.data_category = 1
+  	and  oi.unit_name is not null
   	<if test="techBrokerId != null">
   		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -322,8 +317,7 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
-  		or ui.username = #{unitName,jdbcType=VARCHAR})
+  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   	order by do.serial_number desc
   	<if test="page_sql!=null">
@@ -337,10 +331,9 @@
   	from demand_order do
   	left join demand d on d.id = do.demand_id
   	left join organization_identity oi on oi.uid = do.uid
-  	left join user_identity ui on ui.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
-  	and   d.data_category = 1
+  	and  oi.unit_name is not null
   	<if test="techBrokerId != null">
   		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	</if>
@@ -351,8 +344,7 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
     <if test="unitName != null">
-  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
-  		or ui.username = #{unitName,jdbcType=VARCHAR})
+  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
   	</if>
   </select>
 

+ 3 - 8
src/main/java/com/goafanti/common/mapper/OrganizationIdentityMapper.xml

@@ -1071,8 +1071,7 @@
 		select u.id as uid, i.unit_name as unitName
 		from user u INNER JOIN
 		organization_identity i on u.id = i.uid 
-		where
-		i.audit_status = 5 and u.lvl = 1
+		where u.lvl = 1
 		<if test="_parameter != null">
 			and u.mid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -1083,9 +1082,7 @@
 		select u.id as uid, i.unit_name as unitName
 		from user u INNER JOIN
 		organization_identity i on u.id = i.uid 
-		where
-		i.audit_status = 5 and u.lvl = 1 and i.unit_name like
-				"%"#{name,jdbcType=VARCHAR}"%" 
+		where u.lvl = 1 and i.unit_name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
 		<if test="aid != null">
 			and u.mid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -1096,9 +1093,7 @@
 		select u.id as uid, i.unit_name as unitName
 		from user u INNER JOIN
 		organization_identity i on u.id = i.uid 
-		where
-		i.audit_status = 5 and u.lvl = 1 and i.unit_name like
-				"%"#{name,jdbcType=VARCHAR}"%"
+		where u.lvl = 1 and i.unit_name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
 		<if test="aid != null">
 			and u.aid = #{aid,jdbcType=VARCHAR}
 		</if>

+ 4 - 10
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -379,8 +379,7 @@
 		select u.id as uid, i.username
 		from user u INNER JOIN
 		user_identity i on u.id = i.uid 
-		where
-		i.audit_status = 5 and u.lvl = 1
+		where u.lvl = 1
 		<if test="_parameter != null">
 			and u.mid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -391,8 +390,7 @@
 		select u.id as uid, i.username
 		from user u INNER JOIN
 		user_identity i on u.id = i.uid 
-		where
-		i.audit_status = 5 and u.lvl = 1
+		where u.lvl = 1
 		<if test="_parameter != null">
 			and u.aid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -402,9 +400,7 @@
 		select u.id as uid, ui.username, u.mobile
 			from user u INNER JOIN 
 			user_identity ui on u.id = ui.uid
-			where 
-				ui.audit_status = 5 and u.lvl = 1 and ui.username like
-				"%"#{name,jdbcType=VARCHAR}"%"
+			where u.lvl = 1 and ui.username like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
 			<if test="aid != null">
 				and u.mid = #{aid,jdbcType=VARCHAR}
 			</if>
@@ -415,9 +411,7 @@
 		select u.id as uid, ui.username, u.mobile
 			from user u INNER JOIN 
 			user_identity ui on u.id = ui.uid
-			where 
-				ui.audit_status = 5 and u.lvl = 1 and ui.username like
-				"%"#{name,jdbcType=VARCHAR}"%"
+			where u.lvl = 1 and ui.username like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
 			<if test="aid != null">
 				and u.aid = #{aid,jdbcType=VARCHAR}
 			</if>

+ 4 - 4
src/main/java/com/goafanti/user/bo/InputUserAbility.java

@@ -14,16 +14,16 @@ public class InputUserAbility {
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	abilityLabel;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	@Size(min = 0, max = 400, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	intellectRight;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	@Size(min = 0, max = 400, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	scienceAchievement;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	@Size(min = 0, max = 400, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	researchInnovation;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	@Size(min = 0, max = 400, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	personnel;
 
 	public String getId() {