790477691 opened a new issue, #23491:
URL: https://github.com/apache/shardingsphere/issues/23491
### Which version of ShardingSphere did you use?
4.1.1
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
sharding-jdbc
### Expected behavior
Normally, paging data should be queried
### Actual behavior
The result shows that there is one piece of data, but the data is null
### Reason analyze (If you can)
It could be that the data is queried, but there is a problem in parsing and
cannot encapsulate the parameters into the object
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
2023-01-11 13:56:02 INFO ShardingSphere-SQL:74 - Actual SQL: oracleSource3
::: SELECT * FROM ( SELECT TMP_PAGE.*, ROWNUM ROW_ID FROM ( select
m.status,m.vehicle_number,m.sim_number,m.driver,m.speed,m.depart_name,m.depart_id,
m.type_name,m.position_time,m.lat,m.lon,m.id,m.handler_time,m.handler_name,m.remark,m.type
from mjm_warning m
WHERE m.type in
(
?
)
and m.depart_id like CONCAT(?,'%')
and m.vehicle_number = ?
and m.sim_number = to_number(?)
and m.position_time >= TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss')
and m.position_time <= TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss') )
TMP_PAGE) WHERE ROW_ID <= ? AND ROW_ID > ? ::: [41, 752103, 豫A1111,
14491111783, 2023-01-11 13:05:54, 2023-01-11 13:05:54, 10, 0]
<== Columns:
<== Row:
<== Total: 1
### Example codes for reproduce this issue (such as a github link).
<!--
https://mvnrepository.com/artifact/org.apache.shardingsphere/sharding-jdbc-core
-->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-core</artifactId>
<version>4.1.1</version>
</dependency>
<!--
https://mvnrepository.com/artifact/org.apache.shardingsphere/sharding-jdbc-spring-namespace
-->
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-namespace</artifactId>
<version>4.1.1</version>
</dependency>
<bean id="oracleSource1" parent="parentSource" init-method="init"
destroy-method="close">
<property name="driverClassName"
value="${jdbc.orcl1.driverClassName}"/>
<property name="url" value="${jdbc.orcl1.url}"/>
<property name="username" value="${jdbc.orcl1.username}"/>
<property name="password" value="${jdbc.orcl1.password}"/>
<property name="validationQuery" value="select 1 from dual"/>
</bean>
<bean id="oracleSource2" parent="parentSource" init-method="init"
destroy-method="close">
<property name="driverClassName"
value="${jdbc.orcl2.driverClassName}"/>
<property name="url" value="${jdbc.orcl2.url}"/>
<property name="username" value="${jdbc.orcl2.username}"/>
<property name="password" value="${jdbc.orcl2.password}"/>
<property name="validationQuery" value="select 1 from dual"/>
</bean>
<bean id="oracleSource3" parent="parentSource" init-method="init"
destroy-method="close">
<property name="driverClassName"
value="${jdbc.orcl3.driverClassName}"/>
<property name="url" value="${jdbc.orcl3.url}"/>
<property name="username" value="${jdbc.orcl3.username}"/>
<property name="password" value="${jdbc.orcl3.password}"/>
<property name="validationQuery" value="select 1 from dual"/>
</bean>
<bean id="preciseDatabaseShardingAlgorithm"
class="com.uzhie.dataSoruce.shardingJdbc.PreciseDatabaseShardingAlgorithm" />
<bean id="rangeDatabaseShardingAlgorithm"
class="com.uzhie.dataSoruce.shardingJdbc.RangeDatabaseShardingAlgorithm" />
<sharding:standard-strategy id="databaseShardingStrategy"
sharding-column="TELEPHONE"
precise-algorithm-ref="preciseDatabaseShardingAlgorithm"
range-algorithm-ref="rangeDatabaseShardingAlgorithm" />
<sharding:standard-strategy id="databaseShardingStrategy1"
sharding-column="SIM_NUMBER"
precise-algorithm-ref="preciseDatabaseShardingAlgorithm"
range-algorithm-ref="rangeDatabaseShardingAlgorithm" />
<!-- <sharding:standard-strategy id="tableShardingStrategy"
sharding-column="order_id"
precise-algorithm-ref="preciseModuloTableShardingAlgorithm" />-->
<!-- <sharding:key-generator id="orderKeyGenerator" type="SNOWFLAKE"
column="order_id" />-->
<!-- <sharding:key-generator id="itemKeyGenerator" type="SNOWFLAKE"
column="order_item_id" />-->
<sharding:data-source id="shardingDataSource">
<sharding:sharding-rule
data-source-names="oracleSource1,oracleSource2,oracleSource3">
<sharding:table-rules>
<sharding:table-rule logic-table="MJM_GPS_RECORD"
actual-data-nodes="oracleSource$->{1..3}.MJM_GPS_RECORD"
database-strategy-ref="databaseShardingStrategy" />
<sharding:table-rule logic-table="MJM_WARNING"
actual-data-nodes="oracleSource$->{1..3}.MJM_WARNING"
database-strategy-ref="databaseShardingStrategy1" />
<sharding:table-rule logic-table="MJM_JS_ATTACHMENT"
actual-data-nodes="oracleSource$->{1..3}.MJM_JS_ATTACHMENT"
database-strategy-ref="databaseShardingStrategy1" />
<sharding:table-rule logic-table="MJM_JS_BLIND_AREA"
actual-data-nodes="oracleSource$->{1..3}.MJM_JS_BLIND_AREA"
database-strategy-ref="databaseShardingStrategy1" />
<sharding:table-rule logic-table="MJM_JS_DRIVER_STATUS"
actual-data-nodes="oracleSource$->{1..3}.MJM_JS_DRIVER_STATUS"
database-strategy-ref="databaseShardingStrategy1" />
<sharding:table-rule logic-table="MJM_JS_DRIVING_ASS"
actual-data-nodes="oracleSource$->{1..3}.MJM_JS_DRIVING_ASS"
database-strategy-ref="databaseShardingStrategy1" />
<sharding:table-rule logic-table="WARNING_COLLECT_DAY"
actual-data-nodes="oracleSource$->{1..3}.WARNING_COLLECT_DAY"
database-strategy-ref="databaseShardingStrategy1" />
</sharding:table-rules>
<sharding:binding-table-rules>
<sharding:binding-table-rule
logic-tables="MJM_GPS_RECORD,MJM_WARNING,MJM_JS_ATTACHMENT,MJM_JS_BLIND_AREA,MJM_JS_DRIVER_STATUS,MJM_JS_DRIVING_ASS"
/>
</sharding:binding-table-rules>
<sharding:broadcast-table-rules>
<sharding:broadcast-table-rule
table="MJM_REPORT_LAST_POSITION,MJM_8702,T_SERVER_DB,T_GPS_RECORD_LOG_JOB,MJM_PICTURE_MATCH"
/>
</sharding:broadcast-table-rules>
</sharding:sharding-rule>
<sharding:props>
<prop key="sql.show">true</prop>
</sharding:props>
</sharding:data-source>
List<Warning> warnList = waringDAO.queryListByConditions(simNumber,
vehicleNumber, startTime, endTime,
deptId, alarmControls, sims, bindStatus, page,TypeFrom,GoUp);
<select id="queryListByConditions"
resultType="com.uzhie.web.module.Warning">
select
m.status,m.vehicle_number,m.sim_number,m.driver,m.speed,m.depart_name,m.depart_id,
m.type_name,m.position_time,m.lat,m.lon,m.id,m.handler_time,m.handler_name,m.remark,m.type
from mjm_warning m
<where>
<if test="null != alarmControls and alarmControls.size > 0">
and m.type in
<trim suffixOverrides=" OR m.type IN()"> <!-- 表示删除最后一个条件
-->
<foreach collection="alarmControls" index="index"
item="item" open="(" close=")">
<if test="index != 0">
<choose>
<when test="index % 1000 == 999">) OR m.type
IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{item}
</foreach>
</trim>
</if>
<if test="bindStatus !=null and bindStatus ==1">
<if test="null != sims and sims.size > 0">
and
<foreach collection="sims" item="item" open="("
separator="or" close=")">
m.sim_number in
<foreach collection="item" item="item2" open="("
separator="," close=")">
#{item2}
</foreach>
</foreach>
</if>
</if>
<if test="departId != null and departId !='' ">
and m.depart_id like CONCAT(#{departId},'%')
</if>
<if test="vehicleNumber != null and vehicleNumber !='' ">
and m.vehicle_number = #{vehicleNumber}
</if>
<if test="simNumber != null and simNumber !='' ">
and m.sim_number = to_number(#{simNumber})
</if>
<if test="startTime != null and startTime !='' ">
and m.position_time >= TO_DATE(#{startTime}, 'yyyy-mm-dd
hh24:mi:ss')
</if>
<if test="endTime != null and endTime !='' ">
and m.position_time <= TO_DATE(#{endTime}, 'yyyy-mm-dd
hh24:mi:ss')
</if>
</where>
<if test="TypeFrom==null or TypeFrom==''">
order by m.position_time
</if>
<if test="TypeFrom=='positionTime'">
order by m.position_time
</if>
<if test="TypeFrom=='handlerTime'">
order by m.handler_time
</if>
<if test="GoUp==null or GoUp==0">
desc
</if>
</select>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]