帮我翻译以下代码 <select id="getStatisticalInfoDetailCount" resultType="java.lang.Integer"> select count()from(select psi.station_id,cda.cdc as count_device_code,cda.appkey from (select count(dci.device_code) as cdc,dci.appkey from iledproduction.device_code_info dci where CONV(left(dci.device_code,2),16,10) in <foreach collection="manufacturerIdList" item="item" index="index" open="(" close=")" separator=","> #{item} </foreach> <if test="propMap.size>0 and propMap!=null"> <foreach collection="propMap" index="index" item="item"> <if test='index.toString=="device_type"'> and substr(dci.device_code,3,4) = "${item[1]}" </if> <if test='index.toString=="produce_date"'> and STR_TO_DATE(substr(dci.device_code,7,6),'%y%m%d') BETWEEN "${item[1]}" AND DATE_ADD("${item[2]}",INTERVAL 1 DAY) </if> </foreach> </if> and dci.cert_import_status = 1 group by appkey) as cda left join (select s1.station_id as station_id,s1.old_appkey as appkey from iledproduction.appkey_log s1 union (select s2.station_id as station_id,s2.new_appkey as appkey from iledproduction.appkey_log s2) union (select s3.station_id as station_id,s3.appkey as appkey from iledproduction.production_station_info s3) ) psi on cda.appkey = psi.appkey) a left join (select p.,dpt.manufacturer_id,dpt.department_name from iledproduction.production_station_info p ,iledproduction.department dpt where p.department_key=dpt.department_key) ps on a.station_id = ps.station_id <if test="propMap.size>0 and propMap!=null"> <foreach collection="propMap" index="index" item="item"> <if test='index.toString=="manufacturer_id"'> where ps.manufacturer_id = ${item[1]} </if> </foreach> </if> </select>
时间: 2024-04-13 16:30:59 浏览: 94
Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案
这段代码是一个SQL查询语句,用于统计满足特定条件的数据行数。以下是代码的翻译:
```sql
<select id="getStatisticalInfoDetailCount" resultType="java.lang.Integer">
SELECT count(*) FROM (
SELECT psi.station_id, cda.cdc AS count_device_code, cda.appkey
FROM (
SELECT count(dci.device_code) AS cdc, dci.appkey
FROM iledproduction.device_code_info dci
WHERE CONV(left(dci.device_code,2),16,10) IN
<foreach collection="manufacturerIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="propMap.size>0 and propMap!=null">
<foreach collection="propMap" index="index" item="item">
<if test='index.toString=="device_type"'>
AND substr(dci.device_code,3,4) = "${item[1]}"
</if>
<if test='index.toString=="produce_date"'>
AND STR_TO_DATE(substr(dci.device_code,7,6),'%y%m%d') BETWEEN "${item[1]}" AND DATE_ADD("${item[2]}",INTERVAL 1 DAY)
</if>
</foreach>
</if>
AND dci.cert_import_status = 1
GROUP BY appkey
) AS cda
LEFT JOIN (
SELECT s1.station_id AS station_id, s1.old_appkey AS appkey
FROM iledproduction.appkey_log s1
UNION
SELECT s2.station_id AS station_id, s2.new_appkey AS appkey
FROM iledproduction.appkey_log s2
UNION
SELECT s3.station_id AS station_id, s3.appkey AS appkey
FROM iledproduction.production_station_info s3
) psi ON cda.appkey = psi.appkey
) a
LEFT JOIN (
SELECT p.*, dpt.manufacturer_id, dpt.department_name
FROM iledproduction.production_station_info p, iledproduction.department dpt
WHERE p.department_key = dpt.department_key
) ps ON a.station_id = ps.station_id
<if test="propMap.size>0 and propMap!=null">
<foreach collection="propMap" index="index" item="item">
<if test='index.toString=="manufacturer_id"'>
WHERE ps.manufacturer_id = ${item[1]}
</if>
</foreach>
</if>
</select>
```
希望能对你有所帮助。如果你有任何其他问题,请随时提问。
阅读全文