select b.*,p.id as p_id,p.id,p.proCode,p.proName from smbms.smbms_bill b,smbms_provider p where b.productName like CONCAT('%',#{productName},'%') and b.providerId = #{providerId} and b.isPayment = #{isPayment} and b.providerId = p.id
时间: 2024-04-14 21:27:06 浏览: 118
你想查询 smbms_bill 表和 smbms_provider 表,并根据条件进行筛选,对吗?你希望将账单的所有信息和对应的供应商信息一起返回,是吗?
以下是你提供的 SQL 查询语句:
```sql
SELECT b.*, p.id AS p_id, p.id, p.proCode, p.proName
FROM smbms.smbms_bill b, smbms_provider p
WHERE b.productName LIKE CONCAT('%', #{productName}, '%')
AND b.providerId = #{providerId}
AND b.isPayment = #{isPayment}
AND b.providerId = p.id
```
在这个查询中,我注意到你使用了 `CONCAT` 函数来拼接模糊查询的条件,并且通过别名将供应商的 ID 字段命名为 `p_id`,以避免与账单中的 ID 字段冲突。同时,你在查询条件中使用了占位符(`#{}`)来接收参数值。
请确保在执行查询之前,将占位符中的参数值正确地设置为实际的值。
相关问题
DELIMITER $$ CREATE /*[DEFINER = { user | CURRENT_USER }]*/ PROCEDURE `qy_task`.`peopletask`(IN job VARCHAR(200),IN seriesid VARCHAR(200),IN classid VARCHAR(200),IN prodid VARCHAR(200),IN cycleid VARCHAR(200) ) /*LANGUAGE SQL | [NOT] DETERMINISTIC | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string'*/ BEGIN #把表围绕id创建一边然后再关联输出数据 CREATE TEMPORARY TABLE IF NOT EXISTS taskpeople SELECT gst.job_number, '' AS AREA, SUM(gst.amount) AS amount, SUM(gst.weight) AS weight, SUM(gst.area) AS AREA, SUM(qsc.weight) AS taskweight, SUM(qsc.weight)/SUM(gst.weight) AS percent FROM qy_goal_salesman_task gst INNER JOIN qy_goal_area_task gat ON gat.id =gst.area_task_id INNER JOIN qy_goal_company_task gct ON gct.id=gst.company_task_id INNER JOIN qy_goal_sale_cycle_config scc ON scc.id=gct.cycle_id INNER JOIN qy_goal_prod_config gpc ON gpc.id=gst.prod_id AND gpc.cycle_id=scc.id INNER JOIN qy_goal_prod_series_config psc ON psc.id=gpc.prod_series_id AND psc.cycle_id=scc.id INNER JOIN qy_goal_prod_classify_config pcc ON pcc.id = psc.prod_type_id AND pcc.cycle_id=scc.id INNER JOIN qy_goal_client_task_detail ctd ON gst.salesman_id=ctd.id INNER JOIN qingyuan.sys_circle sc ON sc.id=ctd.client_id INNER JOIN crm_c_duty_saler duty ON duty.c_id=sc.id INNER JOIN qyng_sys_user qsu ON qsu.id= duty.User_Id LEFT JOIN qy_sys_countydetail qsc ON qsc.proname=Pro_Name WHERE scc.id=cycleid AND qsc.CreateTime>=(SELECT start_date FROM qy_goal_sale_cycle_config WHERE id=cycleid) AND qsc.CreateTime<=(SELECT end_date FROM qy_goal_sale_cycle_config WHERE id=cycleid) AND qsc.GetTime=(SELECT MAX(GetTime) FROM qy_sys_countydetail) AND gpc.id=prodid AND pcc.id=classid AND psc.id=seriesid AND gst.job_number=job GROUP BY gst.job_number; #将临时表进行数据转换 UPDATE taskpeople SET job_number= ff.User_Name FROM taskpeople e INNER JOIN qyqx.qy_staff ff ON e.job_number=ff.uid; #查出真正的表 SELECT * FROM taskpeople; #删除临时表 DROP TEMPORARY TABLE taskpeople; END$$ DELIMITER ;这段mysql存储过程哪里出现了语法错误
这段 MySQL 存储过程中出现了语法错误,具体来说是在以下这行代码:
```
GROUP BY gst.job_number;
```
末尾多了一个分号,应该改为:
```
GROUP BY gst.job_number;
```
package M; import javax.swing.*; import java.awt.*; public class GetProInfo extends JPanel{ JTextField name; JTextField category; JTextField leader; JTextField members; JTextField introduction; JTextField applyTime; public GetProInfo(){ JLabel proname=new JLabel("��Ŀ����"); name=new JTextField(10); JLabel procategory=new JLabel("��Ŀ���"); category=new JTextField(10); JLabel proleader=new JLabel("��Ŀ������"); leader=new JTextField(10); JLabel promembers=new JLabel("��Ŀ������Ա"); members=new JTextField(10); JLabel prointroduction=new JLabel("��Ŀ����"); introduction=new JTextField(10); JLabel proapplyTime=new JLabel("��Ŀ����ʱ��"); applyTime=new JTextField(10); this.setLayout(new FlowLayout()); this.add(proname); this.add(name); this.add(procategory); this.add(category); this.add(proleader); this.add(leader); this.add(promembers); this.add(members); this.add(prointroduction); this.add(introduction); this.add(proapplyTime); this.add(applyTime); } public String getname() { String name1=name.getText(); return name1; } public String getcategory() { String category1=category.getText(); return category1; } public String getleader() { String leader1=leader.getText(); return leader1; } public String getmembers() { String members1=members.getText(); return members1; } public String getintroduction() { String introduction1=introduction.getText(); return introduction1; } public String getapplyTime() { String applyTime1=applyTime.getText(); return applyTime1; } }帮我分析
这段代码定义了一个名为GetProInfo的类,是一个继承自JPanel的面板。在面板上定义了六个文本框以及对应的标签,用于获取项目的信息,包括项目名称、项目类别、项目负责人、项目成员、项目介绍、项目申请时间。
在构造函数中,通过设置布局为FlowLayout,将标签和文本框添加到面板上。同时,为了方便获取每个文本框的内容,定义了六个对应的方法,分别返回每个文本框的内容。
阅读全文