@Select("select m.id as module_id,m.is_required,m.title,m.subtitle,m.type,i.file_id,i.product_id,i.pno " + "from wsc_pc_banner_module m left join wsc_pc_banner_image i on i.module_id = m.id " + "${ew.customSqlSegment} and (i.is_deleted is NULL or i.is_deleted = 0) and m.is_deleted = 0 order by m.id") List<WscPcBannerDO> selectBanner(@Param(Constants.WRAPPER) Wrapper wrapper);
重点在于and (i.is_deleted is NULL or i.is_deleted = 0)
根据类型筛选Banner图,前端应该这么传值:
1 2 3
GET {{adminHost}}/microManage/pcBanner?type=0&type=3&type=4&type=5 Content-Type: application/json Authorization: {{adminToken}}
2019-08-20 16:23:07 0x7ff1b2039700 *** (1) TRANSACTION: TRANSACTION 43869195, ACTIVE 3 sec fetching rows mysql tables in use 1, locked 1 LOCK WAIT 6 lock struct(s), heap size 1136, 269 row lock(s) MySQL thread id 746830, OS thread handle 140676071700224, query id 184518127 192.168.3.108 root updating Update pay_log SET tradeState = 2 WHERE tradeState=0 AND createTime < '2019-08-20 15:23:04.167'
*** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 3179 page no 7 n bits 104 index PRIMARY of table `pay`.`pay_log` trx id 43869195 lock_mode X waiting Record lock, heap no 37 PHYSICAL RECORD: n_fields 17; compact format; info bits 0
*** (2) TRANSACTION: TRANSACTION 43869181, ACTIVE 7 sec starting index read mysql tables in use 1, locked 1 4 lock struct(s), heap size 1136, 2 row lock(s), undo log entries 2 MySQL thread id 747008, OS thread handle 140676050425600, query id 184518193 192.168.3.49 root updating Update pay_log SET tradeState =1 WHERE outTradeNo = 'T9744695806' AND tradeState = 0 AND payType = 0
*** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 3179 page no 7 n bits 104 index PRIMARY of table `pay`.`pay_log` trx id 43869181 lock_mode X locks rec but not gap Record lock, heap no 37 PHYSICAL RECORD: n_fields 17; compact format; info bits 0
*** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 3179 page no 4 n bits 168 index PRIMARY of table `pay`.`pay_log` trx id 43869181 lock_mode X waiting Record lock, heap no 2 PHYSICAL RECORD: n_fields 17; compact format; info bits 0 *** WE ROLL BACK TRANSACTION (2)
10:10:23.544: [***] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false checkout -b saas2.2 upstream/saas2.2 -- Branch 'saas2.2'set up to track remote branch 'saas2.2' from 'upstream'. Switched to a new branch 'saas2.2'
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
按提示在测试类加入@SpringBootConfiguration后,报错变了:
1
Parameter 0 of method setXXService in com.XXX.common.XXXServiceImplTest required a bean of type 'com.XXX.common.XXXService' that could not be found.
Parameter 0 of method setXXXMapper in com.XXX.common.service.impl.XXXServiceImpl required a bean of type 'com.XXX.common.domain.repository.XXXMapper' that could not be found.
Parameter 0 of method setObjectMapper in com.XXX.common.service.impl.XXXServiceImpl required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be found.
原来是忘记把Jackson的ObjectMapper纳入Spring 管理了:
1 2 3 4
@Bean public ObjectMapper objectMapper() { returnnewObjectMapper(); }