|  |  |  | 
|---|
|  |  |  | FROM pr_intake tb | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | tb.deleted = 0 | 
|---|
|  |  |  | <if test="intakeName != null and intakeName != ''"> | 
|---|
|  |  |  | AND tb.name LIKE CONCAT('%', #{intakeName}) | 
|---|
|  |  |  | <if test="intakeNum != null and intakeNum != ''"> | 
|---|
|  |  |  | AND tb.name LIKE CONCAT('%', #{intakeNum}) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | 
|---|
|  |  |  | INNER JOIN pr_controller con ON con.intakeId = inta.id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | inta.deleted = 0 | 
|---|
|  |  |  | <if test="intakeName != null and intakeName != ''"> | 
|---|
|  |  |  | AND inta.name LIKE CONCAT('%', #{intakeName}) | 
|---|
|  |  |  | <if test="intakeNum != null and intakeNum != ''"> | 
|---|
|  |  |  | AND inta.name LIKE CONCAT('%', #{intakeNum}) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | ORDER BY inta.id DESC | 
|---|