|  |  |  | 
|---|
|  |  |  | is_present isPresent, | 
|---|
|  |  |  | unit unit, | 
|---|
|  |  |  | measure measure | 
|---|
|  |  |  | from shopping_goods | 
|---|
|  |  |  | from shopping_goods a | 
|---|
|  |  |  | where 1=1 | 
|---|
|  |  |  | <if test="record.queryKey != null and record.queryKey != ''"> | 
|---|
|  |  |  | and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey})) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.cateId!=null"> | 
|---|
|  |  |  | and cate_id=#{record.cateId} | 
|---|
|  |  |  | and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> | 
|---|
|  |  |  | <if test="pageVo.sort !=null  and pageVo.order !=null"> | 
|---|
|  |  |  | 
|---|
|  |  |  | and (instr(name,#{record.queryKey}) or instr(code ,#{record.queryKey}) or instr(zjm ,#{record.queryKey})) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.cateId!=null"> | 
|---|
|  |  |  | and cate_id=#{record.cateId} | 
|---|
|  |  |  | and a.cate_id in ( select b.id from shopping_goods_category b where (b.id=#{record.cateId} or b.parent_id=#{record.cateId})) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|