|  |  | 
 |  |  |             <if test="record.id != null and record.id !='' "> | 
 |  |  |                 and a.ID = #{record.id} | 
 |  |  |             </if> | 
 |  |  |             <if test="record.queryKey != null and record.queryKey !='' "> | 
 |  |  |                 and (instr(b.name, #{record.queryKey}) or instr(b.zjm, #{record.queryKey}) or instr(goods_no, #{record.queryKey})) | 
 |  |  |             </if> | 
 |  |  |             <if test="record.orderItemId != null and record.orderItemId !='' "> | 
 |  |  |                 and a.ORDER_ITEM_ID = #{record.orderItemId} | 
 |  |  |             </if> | 
 |  |  | 
 |  |  |             <if test="record.failTime != null  "> | 
 |  |  |                 and a.FAIL_TIME = #{record.failTime} | 
 |  |  |             </if> | 
 |  |  |  | 
 |  |  |             <if test="record.targetFailTime != null  "> | 
 |  |  |                 and date_format(#{record.failTime}, '%Y-%m-%d') > date_format(a.FAIL_TIME, '%Y-%m-%d') | 
 |  |  |             </if> | 
 |  |  |             <if test="record.price != null and record.price !='' "> | 
 |  |  |                 and a.PRICE = #{record.price} | 
 |  |  |             </if> | 
 |  |  | 
 |  |  |         group by b.id) t | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="selectHasValidProjUse" resultMap="SysProjUseMap"> | 
 |  |  |         select * from sys_proj_use | 
 |  |  |         where date_format(now(), '%Y-%m-%d') > date_format(FAIL_TIME, '%Y-%m-%d') and STATUS='有效' | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  | </mapper> |