Browse Source

修改 模糊查询语法

ruqinhu 5 years ago
parent
commit
6faa6f8ec1
26 changed files with 102 additions and 82 deletions
  1. 1 1
      pom.xml
  2. 16 3
      src/main/java/com/ygj/yuemum/component/DruidConfiguration.java
  3. 1 1
      src/main/java/com/ygj/yuemum/controller/pay/CustomerPayController.java
  4. 1 1
      src/main/resources/mybatis/mapper/admin/JlAdminRoleMapper.xml
  5. 3 3
      src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml
  6. 1 1
      src/main/resources/mybatis/mapper/college/CollegeCurriculumCoreMapper.xml
  7. 2 2
      src/main/resources/mybatis/mapper/college/CollegeCurriculumExperienceMapper.xml
  8. 1 1
      src/main/resources/mybatis/mapper/college/CollegeCurriculumPracticeMapper.xml
  9. 1 1
      src/main/resources/mybatis/mapper/college/CollegePresentScholarshipsLogsMapper.xml
  10. 8 8
      src/main/resources/mybatis/mapper/coupon/CouponBatchMapper.xml
  11. 4 4
      src/main/resources/mybatis/mapper/coupon/CouponCreateMapper.xml
  12. 1 1
      src/main/resources/mybatis/mapper/customer/CustomerBookingMapper.xml
  13. 14 14
      src/main/resources/mybatis/mapper/customer/CustomerCouponMapper.xml
  14. 3 3
      src/main/resources/mybatis/mapper/customer/CustomerInfoBasicDao.xml
  15. 1 1
      src/main/resources/mybatis/mapper/customer/CustomerInfoFeedbackMapper.xml
  16. 2 2
      src/main/resources/mybatis/mapper/customer/CustomerInfoFollowMapper.xml
  17. 2 2
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml
  18. 2 2
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerExtractMapper.xml
  19. 1 1
      src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerMapper.xml
  20. 1 1
      src/main/resources/mybatis/mapper/equipment/EquipmenteHireHeadMapper.xml
  21. 21 19
      src/main/resources/mybatis/mapper/maternitymatron/JlServiceUserMapper.xml
  22. 7 4
      src/main/resources/mybatis/mapper/order/YSOrder.xml
  23. 4 2
      src/main/resources/mybatis/mapper/order/YSOrderServiceLog.xml
  24. 2 2
      src/main/resources/mybatis/mapper/wxmini/WXContentMapper.xml
  25. 1 1
      src/main/resources/mybatis/mapper/wxmini/WXDianPingMapper.xml
  26. 1 1
      src/main/resources/mybatis/mapper/wxmini/WXMMUserSearchMapper.xml

+ 1 - 1
pom.xml

@@ -147,7 +147,7 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>druid</artifactId>
-            <version>1.1.22</version>
+            <version>1.1.23</version>
         </dependency>
         <!--分页-->
         <dependency>

+ 16 - 3
src/main/java/com/ygj/yuemum/component/DruidConfiguration.java

@@ -21,11 +21,11 @@ public class DruidConfiguration {
     ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),
         "/druid/*");
     //白名单为空允许任何ip访问
-    servletRegistrationBean.addInitParameter("allow","127.0.0.1");
+//    servletRegistrationBean.addInitParameter("allow","127.0.0.1");
     //ip黑名单(存在共同时,deny优先于allow):如果满足deny的即提示:Sorry you are not permitted...
-    servletRegistrationBean.addInitParameter("deny","127.0.0.2");
+//    servletRegistrationBean.addInitParameter("deny","127.0.0.2");
     //登录查看信息的账号密码
-    servletRegistrationBean.addInitParameter("loginUsername","yeusuo");
+    servletRegistrationBean.addInitParameter("loginUsername","yuesuo");
     servletRegistrationBean.addInitParameter("loginPassword","yuesuo");
     //是否能够重置数据
     servletRegistrationBean.addInitParameter("resetEnable","true");
@@ -48,7 +48,20 @@ public class DruidConfiguration {
   @ConfigurationProperties(prefix = "spring.datasource")//在application.properties中读取配置信息注入到DruidDataSource里
   public DataSource dataSource(){
     DruidDataSource druidDataSource = (DruidDataSource) DataSourceBuilder.create().type(DruidDataSource.class).build();
+
     druidDataSource.setInitialSize(3);//初始化物理连接的数量
+    druidDataSource.setMaxActive(20);
+    druidDataSource.setMaxWait(60000);//获取连接等待超时的时间
+    druidDataSource.setMinIdle(1); //最小连接池数量
+
+    druidDataSource.setTimeBetweenEvictionRunsMillis(60000);//配置间隔多久才进行一次检测,检测需要关闭的空闲连接
+    druidDataSource.setMinEvictableIdleTimeMillis(300000); //Destory线程中如果检测到当前连接的最后活跃时间和当前时间的差值大于minEvictableIdleTimeMillis,则关闭当前连接
+
+    druidDataSource.setTestWhileIdle(true);
+    druidDataSource.setTestOnBorrow(false);
+    druidDataSource.setTestOnReturn(false);
+    druidDataSource.setValidationQuery("SELECT 'x'");
+
     try {
       druidDataSource.addFilters("stat,wall");//stat是sql监控,wall是防火墙(如果不添加则监控无效),不能添加log4j不然会出错
     } catch (SQLException e) {

+ 1 - 1
src/main/java/com/ygj/yuemum/controller/pay/CustomerPayController.java

@@ -27,7 +27,7 @@ public class CustomerPayController {
     private CustomerPayService customerPayService;
 
     @GetMapping("/selectCustomerPay")
-    public List<CustomerPay> selectCustomerPay(@RequestParam("cp_orderno") String cp_orderno) {
+    public List<CustomerPay> selectCustoqueryYSOrdermerPay(@RequestParam("cp_orderno") String cp_orderno) {
         List<CustomerPay> customerPays = customerPayService.selectCustomerPay(cp_orderno);
         return customerPays;
     }

+ 1 - 1
src/main/resources/mybatis/mapper/admin/JlAdminRoleMapper.xml

@@ -32,7 +32,7 @@
             and id =  #{id,jdbcType=INTEGER}
         </if>
         <if test="jr_rolename != null" >
-            and jr_rolename like "%"#{jr_rolename,jdbcType=VARCHAR}"%"
+            and jr_rolename like concat ('%',#{jr_rolename,jdbcType=VARCHAR},'%')
         </if>
         order by id asc
     </select>

+ 3 - 3
src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml

@@ -67,13 +67,13 @@
         from jl_admin_user
         where username != 'admin'
         <if test="username != null and username !=''">
-            and username like "%"#{username,jdbcType=VARCHAR}"%"
+            and username like concat ('%',#{username,jdbcType=VARCHAR},'%')
         </if>
         <if test="phone != null and phone !=''">
-            and phone like "%"#{phone,jdbcType=VARCHAR}"%"
+            and phone like concat ('%',#{phone,jdbcType=VARCHAR},'%')
         </if>
         <if test="name != null and name !=''">
-            and name like "%"#{name,jdbcType=VARCHAR}"%"
+            and name like concat ('%',#{name,jdbcType=VARCHAR},'%')
         </if>
         <if test="role != null and role !=''">
             and role = #{role,jdbcType=INTEGER}

+ 1 - 1
src/main/resources/mybatis/mapper/college/CollegeCurriculumCoreMapper.xml

@@ -39,7 +39,7 @@
         from college_curriculum_core
         where sys_type = 'YueSuo'
         <if test="c_name != null and c_name != ''">
-            and c_name like "%"#{c_name,jdbcType=VARCHAR}"%"
+            and c_name like concat ('%',#{c_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="c_type != null and c_type != ''">
             and c_type = #{c_type,jdbcType=VARCHAR}

+ 2 - 2
src/main/resources/mybatis/mapper/college/CollegeCurriculumExperienceMapper.xml

@@ -33,7 +33,7 @@
         from college_curriculum_experience as ta
         where 1=1
         <if test="c_name != null and c_name != ''">
-            and c_name like "%"#{c_name,jdbcType=VARCHAR}"%"
+            and c_name like concat ('%',#{c_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="c_type != null and c_type != ''">
             and c_type = #{c_type,jdbcType=VARCHAR}
@@ -48,7 +48,7 @@
             and city = #{city,jdbcType=INTEGER}
         </if>
         <if test="m_name != null and m_name != ''">
-            and m_name like "%"#{m_name,jdbcType=VARCHAR}"%"
+            and m_name like concat ('%',#{m_name,jdbcType=VARCHAR},'%')
         </if>
         order by id desc
     </select>

+ 1 - 1
src/main/resources/mybatis/mapper/college/CollegeCurriculumPracticeMapper.xml

@@ -34,7 +34,7 @@
         from college_curriculum_practice
         where 1=1
         <if test="c_name != null and c_name != ''">
-            and c_name like "%"#{c_name,jdbcType=VARCHAR}"%"
+            and c_name like concat ('%',#{c_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="c_type != null and c_type != ''">
             and c_type = #{c_type,jdbcType=VARCHAR}

+ 1 - 1
src/main/resources/mybatis/mapper/college/CollegePresentScholarshipsLogsMapper.xml

@@ -54,7 +54,7 @@
             and mkt_id = #{mkt_id,jdbcType=INTEGER}
         </if>
         <if test="address != null and address != ''">
-            and address like "%"#{address,jdbcType=VARCHAR}"%"
+            and address like concat ('%',#{address,jdbcType=VARCHAR},'%')
         </if>
         <if test="coupon_number != null and coupon_number != ''">
             and coupon_number = #{coupon_number,jdbcType=VARCHAR}

+ 8 - 8
src/main/resources/mybatis/mapper/coupon/CouponBatchMapper.xml

@@ -124,16 +124,16 @@
             and cb_code = #{cb_code,jdbcType=INTEGER}
         </if>
         <if test="cb_name != null and cb_name != ''">
-            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+            and cb_name like concat ('%',#{cb_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_rule != null and cb_rule != ''">
-            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+            and cb_rule like concat ('%',#{cb_rule,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and cb_citys like "concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
     </select>
 
@@ -149,16 +149,16 @@
             and cb_code = #{cb_code,jdbcType=INTEGER}
         </if>
         <if test="cb_name != null and cb_name != ''">
-            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+            and cb_name like concat ('%',#{cb_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_rule != null and cb_rule != ''">
-            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+            and cb_rule like concat ('%',#{cb_rule,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
 
     </select>

+ 4 - 4
src/main/resources/mybatis/mapper/coupon/CouponCreateMapper.xml

@@ -213,10 +213,10 @@
             and tb.cb_code = #{cb_code,jdbcType=VARCHAR}
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and tb.cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and tb.cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
         <if test="cc_startdate != null and cc_startdate != ''">
             and ta.cc_startdate = #{cc_startdate,jdbcType=VARCHAR}
@@ -261,10 +261,10 @@
             and tb.cb_code = #{cb_code,jdbcType=VARCHAR}
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and tb.cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and tb.cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
         <if test="cc_startdate != null and cc_startdate != ''">
             and ta.cc_startdate = #{cc_startdate,jdbcType=VARCHAR}

+ 1 - 1
src/main/resources/mybatis/mapper/customer/CustomerBookingMapper.xml

@@ -46,7 +46,7 @@
             and bk_introducer_phone = #{bk_introducer_phone,jdbcType=INTEGER}
         </if>
         <if test="bk_introducer_consultant != null and bk_introducer_consultant != ''">
-            and bk_introducer_consultant like "%"#{bk_introducer_consultant,jdbcType=VARCHAR}"%"
+            and bk_introducer_consultant like concat ('%',#{bk_introducer_consultant,jdbcType=VARCHAR},'%')
         </if>
 
         <if test="bk_type != null and bk_type != ''">

+ 14 - 14
src/main/resources/mybatis/mapper/customer/CustomerCouponMapper.xml

@@ -70,10 +70,10 @@
             and ta.cm_phone = #{cm_phone,jdbcType=VARCHAR}
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and tb.cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and tb.cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
         ) tta,
         coupon ttb
@@ -104,10 +104,10 @@
             and ta.cm_phone = #{cm_phone,jdbcType=VARCHAR}
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and tb.cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and tb.cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
         and ta.cp_status = 2
         order by ta.cb_code ,tc.cp_amount desc
@@ -154,10 +154,10 @@
             and ta.cm_phone = #{cm_phone,jdbcType=VARCHAR}
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and tb.cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and tb.cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and tb.cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and tb.cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
         and ta.cp_status = 2
         order by ta.cb_code ,tc.cp_amount desc
@@ -304,16 +304,16 @@
             and cb_code = #{cb_code,jdbcType=INTEGER}
         </if>
         <if test="cb_name != null and cb_name != ''">
-            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+            and cb_name like concat ('%',#{cb_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_rule != null and cb_rule != ''">
-            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+            and cb_rule like concat ('%',#{cb_rule,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and cb_packages like  concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
     </select>
 
@@ -329,16 +329,16 @@
             and cb_code = #{cb_code,jdbcType=INTEGER}
         </if>
         <if test="cb_name != null and cb_name != ''">
-            and cb_name like "%"#{cb_name,jdbcType=VARCHAR}"%"
+            and cb_name like concat ('%',#{cb_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_rule != null and cb_rule != ''">
-            and cb_rule like "%"#{cb_rule,jdbcType=VARCHAR}"%"
+            and cb_rule like concat ('%',#{cb_rule,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_packages != null and cb_packages != ''">
-            and cb_packages like "%"#{cb_packages,jdbcType=VARCHAR}"%"
+            and cb_packages like concat ('%',#{cb_packages,jdbcType=VARCHAR},'%')
         </if>
         <if test="cb_citys != null and cb_citys != ''">
-            and cb_citys like "%"#{cb_citys,jdbcType=VARCHAR}"%"
+            and cb_citys like concat ('%',#{cb_citys,jdbcType=VARCHAR},'%')
         </if>
 
     </select>

+ 3 - 3
src/main/resources/mybatis/mapper/customer/CustomerInfoBasicDao.xml

@@ -226,9 +226,9 @@
         </if>
         <if test="fb_customer_phone != null and fb_customer_phone !=''">
             and
-            ( fb_customer_phone like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%"
+            ( fb_customer_phone like concat ('%',#{fb_customer_phone,jdbcType=VARCHAR},'%')
                                 or
-              fb_customer_name like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%"
+              fb_customer_name like concat ('%',#{fb_customer_phone,jdbcType=VARCHAR},'%')
             )
         </if>
         <if test="branche_name != null ">
@@ -250,7 +250,7 @@
             </foreach>
         </if>
         <if test="fb_customer_name != null and fb_customer_name !=''">
-            and fb_customer_name like "%"#{fb_customer_name,jdbcType=VARCHAR}"%"
+            and fb_customer_name like concat ('%',#{fb_customer_name,jdbcType=VARCHAR},'%')
         </if>
         order by id desc
     </select>

+ 1 - 1
src/main/resources/mybatis/mapper/customer/CustomerInfoFeedbackMapper.xml

@@ -50,7 +50,7 @@
             </foreach>
         </if>
         <if test="fb_customer_phone != null and fb_customer_phone !=''">
-            and ( fb_customer_phone like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%" or fb_customer_name like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%" )
+            and ( fb_customer_phone like concat ('%',#{fb_customer_phone,jdbcType=VARCHAR},'%') or fb_customer_name like concat ('%',#{fb_customer_phone,jdbcType=VARCHAR},'%') )
         </if>
         <if test="branche_name != null ">
             and branche_name in

+ 2 - 2
src/main/resources/mybatis/mapper/customer/CustomerInfoFollowMapper.xml

@@ -196,10 +196,10 @@
             and fb_Date &lt; #{end_fb_date}
         </if>
         <if test="follow_state != null and follow_state !=''">
-            and follow_state like "%"#{follow_state,jdbcType=VARCHAR}"%"
+            and follow_state like concat ('%',#{follow_state,jdbcType=VARCHAR},'%')
         </if>
         <if test="fb_customer_phone != null and fb_customer_phone !=''">
-            and fb_customer_phone like "%"#{fb_customer_phone,jdbcType=VARCHAR}"%"
+            and fb_customer_phone like concat ('%',#{fb_customer_phone,jdbcType=VARCHAR},'%')
         </if>
         <if test="create_person != null ">
             and create_person in

+ 2 - 2
src/main/resources/mybatis/mapper/distributionchannel/DcIntroduceLogMapper.xml

@@ -179,10 +179,10 @@
             and ta.xul_date &gt;= #{start_date,jdbcType=DATE}
         </if>
         <if test="xul_phone != null and xul_phone != ''">
-            and ta.xul_phone like "%"#{xul_phone,jdbcType=VARCHAR}"%"
+            and ta.xul_phone like concat ('%',#{xul_phone,jdbcType=VARCHAR},'%')
         </if>
         <if test="xul_introducer_phone != null and xul_introducer_phone != ''">
-            and ta.xul_introducer_phone like "%"#{xul_introducer_phone,jdbcType=VARCHAR}"%"
+            and ta.xul_introducer_phone like concat ('%',#{xul_introducer_phone,jdbcType=VARCHAR},'%')
         </if>
         <if test="end_date != null and end_date != ''">
             and ta.xul_date &lt;= #{end_date,jdbcType=DATE}

+ 2 - 2
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerExtractMapper.xml

@@ -114,10 +114,10 @@
             and wue_phone = #{wue_phone,jdbcType=VARCHAR}
         </if>
         <if test="wue_account_name != null and wue_account_name != ''">
-            and wue_account_name like  "%"#{wue_account_name,jdbcType=VARCHAR}"%"
+            and wue_account_name like  concat ('%',#{wue_account_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="wue_bank_card != null and wue_bank_card != ''">
-            and wue_bank_card like  "%"#{wue_bank_card,jdbcType=VARCHAR}"%"
+            and wue_bank_card like  concat ('%',#{wue_bank_card,jdbcType=VARCHAR},'%')
         </if>
         <if test="wue_type != null and wue_type != ''">
             and wue_type = #{wue_type,jdbcType=INTEGER}

+ 1 - 1
src/main/resources/mybatis/mapper/distributionchannel/DcIntroducerMapper.xml

@@ -149,7 +149,7 @@
             and wv_phone = #{wv_phone,jdbcType=VARCHAR}
         </if>
         <if test="wv_name != null and wv_name != ''">
-            and wv_name like "%"#{wv_name,jdbcType=VARCHAR}"%"
+            and wv_name like concat ('%',#{wv_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="dc_channel != null and dc_channel != ''">
             and dc_channel = #{dc_channel,jdbcType=VARCHAR}

+ 1 - 1
src/main/resources/mybatis/mapper/equipment/EquipmenteHireHeadMapper.xml

@@ -82,7 +82,7 @@
                     and equipment_hire_head.eh_cmname = #{eh_cmname,jdbcType=VARCHAR}
                 </if>
                 <if test="eh_cmaddress != null and eh_cmaddress != ''">
-                    and equipment_hire_head.eh_cmaddress like "%"#{eh_cmaddress,jdbcType=VARCHAR}"%"
+                    and equipment_hire_head.eh_cmaddress like concat ('%',#{eh_cmaddress,jdbcType=VARCHAR},'%')
                 </if>
                 <if test="eh_cmidcard != null and eh_cmidcard != ''">
                     and equipment_hire_head.eh_cmidcard = #{eh_cmidcard,jdbcType=VARCHAR}

+ 21 - 19
src/main/resources/mybatis/mapper/maternitymatron/JlServiceUserMapper.xml

@@ -100,13 +100,13 @@
             and jl_service_user.id = #{id,jdbcType=INTEGER}
         </if>
         <if test="salt != null and salt !=''">
-            and jl_service_user.salt like "%"#{salt,jdbcType=VARCHAR}"%"
+            and jl_service_user.salt like concat ('%',#{salt,jdbcType=VARCHAR},'%')
         </if>
         <if test="truename != null and truename !=''">
-            and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
+            and jl_service_user.truename like concat ('%',#{truename,jdbcType=VARCHAR},'%')
         </if>
         <if test="constellation != null and constellation !=''">
-            and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
+            and constellation like concat ('%',#{constellation,jdbcType=VARCHAR},'%')
         </if>
         <if test="zodiac != null and zodiac !=''">
             and zodiac = #{zodiac,jdbcType=VARCHAR}
@@ -130,7 +130,7 @@
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null ">
-            and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
+            and citycode like concat ('%',#{cityname,jdbcType=VARCHAR},'%')
         </if>
         <if test="ethnicgroup != null ">
             and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
@@ -145,7 +145,8 @@
             and marriage = #{marriage,jdbcType=VARCHAR}
         </if>
         <if test="highlight != null ">
-            and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
+            and highlight like concat ('%',
+            #{highlight,jdbcType=VARCHAR},'%')
         </if>
         <if test="weight != null ">
             and weight = #{weight,jdbcType=VARCHAR}
@@ -179,7 +180,8 @@
             and jl_service_user.id = #{id,jdbcType=INTEGER}
         </if>
         <if test="truename != null and truename != ''">
-            and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
+            and jl_service_user.truename like concat ('%',
+            #{truename,jdbcType=VARCHAR},'%')
         </if>
         <if test="status != null and status != ''">
             and status = #{status,jdbcType=VARCHAR}
@@ -188,7 +190,7 @@
             and idcard = #{idcard,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null and cityname != ''">
-            and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
+            and citycode like concat ('%',#{cityname,jdbcType=VARCHAR},'%')
         </if>
         <if test="np != null and np != ''">
             and city = #{np,jdbcType=VARCHAR}
@@ -200,7 +202,7 @@
             and gender = #{gender,jdbcType=INTEGER}
         </if>
         <if test="salt != null and salt != ''">
-            and salt like "%"#{salt,jdbcType=VARCHAR}"%"
+            and salt like concat ('%',#{salt,jdbcType=VARCHAR},'%')
         </if>
     </select>
     <!--getList-->
@@ -273,7 +275,7 @@
             and jl_service_user.id = #{id,jdbcType=INTEGER}
         </if>
         <if test="truename != null">
-            and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
+            and jl_service_user.truename like concat ('%',#{truename,jdbcType=VARCHAR},'%')
         </if>
         <if test="status != null ">
             and status = #{status,jdbcType=VARCHAR}
@@ -282,7 +284,7 @@
             and idcard = #{idcard,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null ">
-            and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
+            and citycode like concat ('%',#{cityname,jdbcType=VARCHAR},'%')
         </if>
         <if test="np != null ">
             and city = #{np,jdbcType=VARCHAR}
@@ -294,7 +296,7 @@
             and gender = #{gender,jdbcType=INTEGER}
         </if>
         <if test="salt != null and salt !=''">
-            and salt like "%"#{salt,jdbcType=VARCHAR}"%"
+            and salt like concat ('%',#{salt,jdbcType=VARCHAR},'%')
         </if>
         order by id
     </select>
@@ -367,10 +369,10 @@
             and FIND_IN_SET(jl_service_user.id,#{ids,jdbcType=INTEGER}) = 0
         </if>
         <if test="salt != null and salt !=''">
-            and jl_service_user.salt like "%"#{salt,jdbcType=VARCHAR}"%"
+            and jl_service_user.salt like concat ('%',#{salt,jdbcType=VARCHAR},'%')
         </if>
         <if test="truename != null ">
-            and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
+            and jl_service_user.truename like concat ('%',#{truename,jdbcType=VARCHAR},'%')
         </if>
         <if test="constellation != null ">
             and constellation in
@@ -406,7 +408,7 @@
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null ">
-            and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
+            and citycode like concat ('%',#{cityname,jdbcType=VARCHAR},'%')
         </if>
         <if test="ethnicgroup != null ">
             and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
@@ -425,7 +427,7 @@
             and marriage = #{marriage,jdbcType=VARCHAR}
         </if>
         <if test="highlight != null ">
-            and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
+            and highlight like concat ('%',#{highlight,jdbcType=VARCHAR},'%')
         </if>
         <if test="weight != null ">
             and weight = #{weight,jdbcType=VARCHAR}
@@ -676,10 +678,10 @@
             and jl_service_user.id = #{id,jdbcType=INTEGER}
         </if>
         <if test="truename != null ">
-            and jl_service_user.truename like "%"#{truename,jdbcType=VARCHAR}"%"
+            and jl_service_user.truename like concat ('%',#{truename,jdbcType=VARCHAR},'%')
         </if>
         <if test="constellation != null ">
-            and constellation like "%"#{constellation,jdbcType=VARCHAR}"%"
+            and constellation like concat ('%',#{constellation,jdbcType=VARCHAR},'%')
         </if>
         <if test="zodiac != null ">
             and zodiac = #{zodiac,jdbcType=VARCHAR}
@@ -703,7 +705,7 @@
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null ">
-            and citycode like "%"#{cityname,jdbcType=VARCHAR}"%"
+            and citycode like concat ('%',#{cityname,jdbcType=VARCHAR},'%')
         </if>
         <if test="ethnicgroup != null ">
             and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
@@ -718,7 +720,7 @@
             and marriage = #{marriage,jdbcType=VARCHAR}
         </if>
         <if test="highlight != null ">
-            and highlight like "%"#{highlight,jdbcType=VARCHAR}"%"
+            and highlight like concat ('%',#{highlight,jdbcType=VARCHAR},'%')
         </if>
         <if test="weight != null ">
             and weight = #{weight,jdbcType=VARCHAR}

+ 7 - 4
src/main/resources/mybatis/mapper/order/YSOrder.xml

@@ -123,14 +123,17 @@
         od_date
         from ys_order
         where od_status != 99
+        <if test="od_date != null and od_date != ''">
+            and od_date like concat ('%',#{od_date,jdbcType=VARCHAR},'%')
+        </if>
         <if test="od_no != null and od_no != ''">
-            and od_no like "%"#{od_no,jdbcType=VARCHAR}"%"
+            and od_no like concat ('%',#{od_no,jdbcType=VARCHAR},'%')
         </if>
         <if test="od_user_address != null and od_user_address != ''">
-            and od_user_address like "%"#{od_user_address,jdbcType=VARCHAR}"%"
+            and od_user_address like concat ('%',#{od_user_address,jdbcType=VARCHAR},'%')
         </if>
         <if test="od_user_name != null and od_user_name != ''">
-            and od_user_name like "%"#{od_user_name,jdbcType=VARCHAR}"%"
+            and od_user_name like concat ('%',#{od_user_name,jdbcType=VARCHAR},'%')
         </if>
         <if test="od_startdate != null and od_startdate != ''">
             and DATE_FORMAT(od_startdate,'%Y-%m-%d') &gt;= DATE_FORMAT(#{od_startdate,jdbcType=DATE},'%Y-%m-%d')
@@ -157,7 +160,7 @@
             and od_cityid = #{od_cityid,jdbcType=INTEGER}
         </if>
         <if test="od_contract != null and od_contract != ''">
-            and od_contract like "%"#{od_contract,jdbcType=VARCHAR}"%"
+            and od_contract like concat ('%',#{od_contract,jdbcType=VARCHAR},'%')
         </if>
         <if test="od_consultantid != null and od_consultantid != ''">
             and od_consultantid = #{od_consultantid,jdbcType=INTEGER}

+ 4 - 2
src/main/resources/mybatis/mapper/order/YSOrderServiceLog.xml

@@ -34,10 +34,12 @@
         from ys_order_servicelog
         where 1=1
         <if test="od_no != null and od_no != ''">
-            and od_no like "%"#{od_no,jdbcType=VARCHAR}"%"
+            and od_no like concat ('%',
+            #{od_no,jdbcType=VARCHAR},'%')
         </if>
         <if test="od_mmid != null and od_mmid != ''">
-            and od_mmid like "%"#{od_mmid,jdbcType=INTEGER}"%"
+            and od_mmid like concat ('%',
+            #{od_mmid,jdbcType=INTEGER},'%')
         </if>
         <if test="od_startdate != null and od_startdate != ''">
             and DATE_FORMAT(od_startdate,'%Y-%m-%d') = DATE_FORMAT(#{od_startdate,jdbcType=DATE},'%Y-%m-%d')

+ 2 - 2
src/main/resources/mybatis/mapper/wxmini/WXContentMapper.xml

@@ -55,10 +55,10 @@
         LEFT JOIN wx_content_type ON wx_content.wc_type = wx_content_type.wct_code
         where 1=1
         <if test="wc_title != null and wc_title != ''">
-            and wc_title  like "%"#{wc_title,jdbcType=VARCHAR}"%"
+            and wc_title  like concat ('%',#{wc_title,jdbcType=VARCHAR},'%')
         </if>
         <if test="wc_content != null and wc_content != ''">
-            and wc_content  like "%"#{wc_content,jdbcType=VARCHAR}"%"
+            and wc_content  like concat ('%',#{wc_content,jdbcType=VARCHAR},'%')
         </if>
         <if test="wc_type != null and wc_type != ''">
             and wc_type = #{wc_type,jdbcType=VARCHAR}

+ 1 - 1
src/main/resources/mybatis/mapper/wxmini/WXDianPingMapper.xml

@@ -44,7 +44,7 @@
         from wx_dianping LEFT JOIN (select wd_id,count(1) tj from wx_dianping_images GROUP BY wd_id) tb on wx_dianping.id = tb.wd_id
         where 1=1
         <if test="wd_username != null and wd_username != ''">
-            and wd_username like "%"#{wd_username,jdbcType=VARCHAR}"%"
+            and wd_username like concat ('%',#{wd_username,jdbcType=VARCHAR},'%')
         </if>
         <if test="wd_date != null and wd_date != ''">
             and DATE_FORMAT(wd_date,'%Y-%m-%d') = DATE_FORMAT(#{wd_date,jdbcType=DATE},'%Y-%m-%d')

+ 1 - 1
src/main/resources/mybatis/mapper/wxmini/WXMMUserSearchMapper.xml

@@ -31,7 +31,7 @@
         from wx_mm_user_search
         where 1=1
         <if test="wmu_openid != null and wmu_openid != ''">
-            and wmu_openid like "%"#{wmu_openid,jdbcType=VARCHAR}"%"
+            and wmu_openid like concat ('%',#{wmu_openid,jdbcType=VARCHAR},'%')
         </if>
         <if test="wmu_phone != null and wmu_phone != ''">
             and wmu_phone = #{wmu_phone,jdbcType=INTEGER}