浏览代码

fix sql语句错误

tjf 3 年之前
父节点
当前提交
45760ad13a

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/CzrkController.java

@@ -61,6 +61,11 @@ public class CzrkController extends BaseController {
         return AjaxResult.success("成功", czrkService.getById(id));
     }
 
+    /**
+     * 统计中点击新增的列表
+     * @param czrk
+     * @return
+     */
     @GetMapping("/listByXz")
     public TableDataInfo listByXz(Czrk czrk) {
         List<Czrk> list = czrkService.listByXz(czrk);

+ 5 - 19
boman-web-core/src/main/resources/mapper/CzrkMapper.xml

@@ -268,9 +268,9 @@
         select vi.id, vi.create_time, vi.update_time, vi.is_del, vi.update_by, vi.user_name, vi.phone_num, vi.id_card
         , vi.gender, vi.province, vi.city, vi.region, vi.now_in, vi.house_type, vi.update_by, vi.code
         from czrk vi
-        where vi.status = '1' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
+        where vi.status = '1' and is_del = 'N' and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat( #{userName}, '%') or vi.id_card like concat( #{userName}, '%'))
+            and vi.user_name like concat( #{userName}, '%')
         </if>
         <if test="villageTowns != null  and villageTowns != ''">
             and vi.village_towns = #{villageTowns}
@@ -293,13 +293,6 @@
         <if test="workUnit != null  and workUnit != ''">and vi.work_unit = #{workUnit}</if>
         <if test="nowIn != null  and nowIn != ''">and vi.now_in = #{nowIn}</if>
         <if test="gridId != null  and gridId != ''">and vi.grid_id = #{gridId}</if>
-
-        <if test="deptIdList != null  and deptIdList.size() > 0">
-            and vi.dept_id in
-            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
-                #{deptId}
-            </foreach>
-        </if>
     </select>
 
     <select id="countByCzXz" resultType="int">
@@ -334,7 +327,7 @@
         from czrk vi
         where vi.status in ('2','3','4') and vi.update_time &gt;= #{startTime} and vi.update_time &lt;= #{endTime}
         <if test="userName != null  and userName != ''">
-            and (vi.user_name like concat(#{userName}, '%') or vi.id_card like concat(#{userName}, '%'))
+            and vi.user_name like concat(#{userName}, '%')
         </if>
         <if test="villageTowns != null  and villageTowns != ''">
             and vi.village_towns = #{villageTowns}
@@ -358,13 +351,6 @@
         <if test="workUnit != null  and workUnit != ''">and vi.work_unit = #{workUnit}</if>
         <if test="nowIn != null  and nowIn != ''">and vi.now_in = #{nowIn}</if>
         <if test="gridId != null  and gridId != ''">and vi.grid_id = #{gridId}</if>
-
-        <if test="deptIdList != null  and deptIdList.size() > 0">
-            and vi.dept_id in
-            <foreach item="deptId" collection="deptIdList" open="(" separator="," close=")">
-                #{deptId}
-            </foreach>
-        </if>
     </select>
 
     <select id="countByCzJs" resultType="int">
@@ -399,7 +385,7 @@
         , vi.house_type, vi.update_by, vi.code, vi.rlr, vi.yhzgx
         from czrk vi
         <!--把户主放第一位-->
-        where vi.is_del = 'N' and code = #{code} order by house_type desc;
+        where vi.is_del = 'N' and code = #{code} order by house_type desc
     </select>
 
     <select id="listByCodeSynchronization" resultMap="CzrkResult">
@@ -409,7 +395,7 @@
         vi.now_in, vi.code
         from czrk vi
         <!--把户主放第一位-->
-        where vi.is_del = 'N' and code = #{code} order by house_type desc;
+        where vi.is_del = 'N' and code = #{code} order by house_type desc
     </select>