guantao 3 роки тому
батько
коміт
0f0826918a

+ 2 - 2
wxdks/src/main/java/com/c3/wxdks/entity/Recruit.java

@@ -25,11 +25,11 @@ public class Recruit {
     /**
      * 薪资范围下
      */
-    private String minSalary;
+    private Integer minSalary;
     /**
      * 薪资范围上
      */
-    private String maxSalary;
+    private Integer maxSalary;
     /**
      * 公司规模
      */

+ 15 - 6
wxdks/src/main/resources/com/c3/wxdks/mapper/RecruitMapper.xml

@@ -136,12 +136,21 @@
             <if test="scale != null and scale != ''">
                 and scale = #{scale}
             </if>
-            <if test="minSalary != null and minSalary != ''">
-                and (#{minSalary} between min_salary and max_salary)
-            </if>
-            <if test="maxSalary != null and maxSalary != ''">
-                and max_salary >= #{maxSalary}
-            </if>
+            and (
+                    <if test="minSalary != null and minSalary != ''">
+                         ((#{minSalary} &gt;= min_salary OR max_salary IS NULL) and ( #{minSalary} &lt;= max_salary or max_salary is null))
+                    </if>
+                    <if test="(minSalary != null and minSalary != '') and (maxSalary != null and maxSalary != '')">
+                        or
+                    </if>
+                    <if test="maxSalary != null and maxSalary != ''">
+                         ((#{maxSalary} &gt;= min_salary OR max_salary IS NULL) and ( #{maxSalary} &lt;= max_salary or max_salary is null))
+                    </if>
+                    <if test="(minSalary != null and minSalary != '') or (maxSalary != null and maxSalary != '')">
+                        and
+                    </if>
+                    1 = 1
+                )
         <if test="page != null and limit != null and limit > 0">
             LIMIT #{page}, #{limit}
         </if>

+ 31 - 8
wxdks/src/main/resources/static/zlhbw/jrwm/jrwm.js

@@ -99,13 +99,27 @@ function initPageClick() {
 		var hasExpClass = $(this).parent().hasClass('work-exp');
 		var hasEduClass = $(this).parent().hasClass('education-require');
 		if (hasExpClass) {
-			condition.workExperience = $(this).attr('data-value');
-			$(this).addClass("textActive").siblings("span").removeClass("textActive");
+			var hasActive = $(this).hasClass('textActive');
+			if (hasActive) {
+				$(this).removeClass('textActive');
+				condition.workExperience = '';
+			} else {
+				$(this).addClass('textActive');
+				condition.workExperience = $(this).attr('data-value');
+			}
+			// $(this).addClass("textActive").siblings("span").removeClass("textActive");
 			getRecruitList();
 		}
 		if (hasEduClass) {
-			condition.education = $(this).attr('data-value');
-			$(this).addClass("textActive").siblings("span").removeClass("textActive");
+			var hasActive = $(this).hasClass('textActive');
+			if (hasActive) {
+				$(this).removeClass('textActive');
+				condition.education = '';
+			} else {
+				$(this).addClass('textActive');
+				condition.education = $(this).attr('data-value');
+			}
+			// $(this).addClass("textActive").siblings("span").removeClass("textActive");
 			getRecruitList();
 		}
 	})
@@ -168,6 +182,8 @@ function getRecruitList() {
 		success: function (json) {
 			const data = json.data;
 			console.log(data)
+			var el = $('.list-container');
+			el.empty();
 			if (json.result && data && data.length > 0) {
 				var html = '';
 				for (var i = 0; i < data.length; i++) {
@@ -178,21 +194,21 @@ function getRecruitList() {
 										'<span class="zp-name">' + obj.workName + '</span>' +
 										'<span class="zp-time">' + obj.createTime.split(' ')[0] + '发布</span>' +
 									'</div>' +
-									'<div class="right">' + obj.minSalary + '-' + obj.maxSalary + '</div>' +
+									'<div class="right">' + numberToChar(obj.minSalary) + ( obj.maxSalary ? '-' + numberToChar(obj.maxSalary) : '+' ) + '</div>' +
 								'</div>' +
 								'<p class="zp-enterprise">' + obj.orgName + '</p>' +
 								'<div class="zp-second">' +
 									'<span class="zprs">' +
 										'招聘人数:' + obj.recruitNum + '人丨' +
-										'工作经验:' + obj.workExp + ' 丨 ' +
-										'学历:' + obj.edu + ' 丨' +
+										'工作经验:' + (obj.workExp ? obj.workExp : '不限') + ' 丨 ' +
+										'学历:' + (obj.edu ? obj.edu : '不限') + ' 丨' +
 										'地点:' + (obj.address ? obj.address : '暂无') +
 									'</span>' +
 									'<div class="zp-detail" data-id="' + obj.id + '">查看详情</div>' +
 								'</div>' +
 							'</div>'
 				}
-				$('.list-container').empty().append(html);
+				el.append(html);
 			}
 
 			if (!json.result) {
@@ -201,3 +217,10 @@ function getRecruitList() {
 		}
 	})
 }
+
+/**
+ * 整数工资转换为K
+ */
+function numberToChar(num) {
+	return (num / 1000) + 'k';
+}

+ 3 - 2
wxdks/src/main/resources/static/zlhbw/js/search.js

@@ -5,13 +5,13 @@ var paging = {
 };
 layui.config({
     base: '../../page/js/encryption/'
-}).use(['layer', 'jquery', 'ajax', 'laypage'], function() {
+}).use(['layer', 'jquery', 'laypage'], function() {
     layer = layui.layer,
         $ = layui.jquery,
         laypage = layui.laypage;
 
     initPageClick();
-     initPageList();
+    initPageList();
 })
 
 /**
@@ -118,6 +118,7 @@ function clickDetail(id, type, columnId, columnName) {
 		window.open('jgjj/jgjj.html');
 	} else {
 	    sessionStorage.setItem('company-id', id);
+	    sessionStorage.setItem('column-name', '搜索');
         window.open('jgzs/jgzs.html');
 	}
 }

+ 4 - 18
wxdks/src/main/resources/static/zlhbw/xfz/xfz.js

@@ -64,25 +64,11 @@ layui.config({
     // 点击tag删除,取消选中
     $('.tagi').on('click', '.layui-icon-close', function(ele) {
 
-        var tagId = $(this).attr("data-id"); //获取要取消选中的对应id
-        var spanText = $(this).siblings("span").text();
-        var sortCheck = $(".sort .layui-form-checkbox");
-        var flCheck = $(".frist_sort .sort_item")
-        for (var i = 0; i < sortCheck.length; i++) {
-            var text = $(sortCheck[i]).text();
-            if (spanText == text) {
-                $(sortCheck[i]).removeClass("layui-form-checked");
-            }
-        }
-
-        for (var j = 0; j < flCheck.length; j++) {
-            var text = $($(flCheck[j])).find(".sort_ititle").text()
-            if (spanText == text) {
-                $(flCheck[j]).removeClass("active_sort");
-            }
-        }
+        var dataId = $(this).parent().attr('data-id');
+        $('.sort_box input[data-id=' + dataId + ']')[0].checked = false;
 
         $(this).parent().remove();
+        form.render();
 
         renderCompanyList();
     })
@@ -395,4 +381,4 @@ function appendTwoLayerClassify(parentKey, columnKey) {
             }
         }
     })
-}
+}