dongoewang opened a new issue, #30600:
URL: https://github.com/apache/shardingsphere/issues/30600

   ## Bug Report
   shardingsphere can,t  correctly rewrite sql
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   shardingshpere-5.4.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   shardingsphere ccorrectly rewrite sql
   ### Actual behavior
   only rewrite first logic table
   ### Reason analyze (If you can)
   i don,t know
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   resource file
   `    <update id="updateList" parameterType="java.util.List">
           <foreach collection="list" item="item" index="index" open="" 
close="" separator=";">
               update kq_attendance_daily
               <set>
                   attendance_plan_id = #{item.attendancePlanId},
                   plan_type = #{item.planType},
                   attendence_time = #{item.attendenceTime},
                   real_time = #{item.realTime},
                   <if test="item.organId != null">
                       organ_id = #{item.organId},
                   </if>
                   <if test="item.employeeId != null">
                       employee_id = #{item.employeeId},
                   </if>
                   <if test="item.deptId != null">
                       dept_id = #{item.deptId},
                   </if>
                   <if test="item.postId != null">
                       post_id = #{item.postId},
                   </if>
                   <if test="item.attendanceDate != null">
                       attendance_date = #{item.attendanceDate},
                   </if>
                   <if test="item.crossDay != null and item.crossDay != ''">
                       cross_day = #{item.crossDay},
                   </if>
                   <if test="item.workType != null and item.workType != ''">
                       work_type = #{item.workType},
                   </if>
                   <if test="item.workCount != null">
                       work_count = #{item.workCount},
                   </if>
                   <if test="item.attendanceStatus != null and 
item.attendanceStatus != ''">
                       attendance_status = #{item.attendanceStatus},
                   </if>
                   <if test="item.businessLeave != null">
                       business_leave = #{item.businessLeave},
                   </if>
                   <if test="item.gooutLeave != null">
                       goout_leave = #{item.gooutLeave},
                   </if>
                   <if test="item.overTimeHour != null">
                       over_time_hour = #{item.overTimeHour},
                   </if>
                   <if test="item.overTimeHourSalary != null">
                       over_time_hour_salary = #{item.overTimeHourSalary},
                   </if>
                   <if test="item.leaveHour != null">
                       leave_hour = #{item.leaveHour},
                   </if>
                   <if test="item.leaveDay != null">
                       leave_day = #{item.leaveDay},
                   </if>
                   <if test="item.leavePaidHour != null">
                       leave_paid_hour = #{item.leavePaidHour},
                   </if>
                   <if test="item.compassionateLeave != null">
                       compassionate_leave = #{item.compassionateLeave},
                   </if>
                   <if test="item.compassionateLeaveDays != null">
                       compassionate_leave_days = 
#{item.compassionateLeaveDays},
                   </if>
                   <if test="item.compassionateLeaveUnit != null and 
item.compassionateLeaveUnit != ''">
                       compassionate_leave_unit = 
#{item.compassionateLeaveUnit},
                   </if>
                   <if test="item.sickLeave != null">
                       sick_leave = #{item.sickLeave},
                   </if>
                   <if test="item.sickLeaveDays != null">
                       sick_leave_days = #{item.sickLeaveDays},
                   </if>
                   <if test="item.sickLeaveUnit != null and item.sickLeaveUnit 
!= ''">
                       sick_leave_unit = #{item.sickLeaveUnit},
                   </if>
                   <if test="item.compensatoryLeave != null">
                       compensatory_leave = #{item.compensatoryLeave},
                   </if>
                   <if test="item.compensatoryLeaveDays != null">
                       compensatory_leave_days = #{item.compensatoryLeaveDays},
                   </if>
                   <if test="item.compensatoryLeaveUnit != null and 
item.compensatoryLeaveUnit != ''">
                       compensatory_leave_unit = #{item.compensatoryLeaveUnit},
                   </if>
                   <if test="item.annualLeave != null">
                       annual_leave = #{item.annualLeave},
                   </if>
                   <if test="item.annualLeaveDays != null">
                       annual_leave_days = #{item.annualLeaveDays},
                   </if>
                   <if test="item.annualLeaveUnit != null and 
item.annualLeaveUnit != ''">
                       annual_leave_unit = #{item.annualLeaveUnit},
                   </if>
                   <if test="item.maternityLeave != null">
                       maternity_leave = #{item.maternityLeave},
                   </if>
                   <if test="item.maternityLeaveDays != null">
                       maternity_leave_days = #{item.maternityLeaveDays},
                   </if>
                   <if test="item.maternityLeaveUnit != null and 
item.maternityLeaveUnit != ''">
                       maternity_leave_unit = #{item.maternityLeaveUnit},
                   </if>
                   <if test="item.funeralLeave != null">
                       funeral_leave = #{item.funeralLeave},
                   </if>
                   <if test="item.funeralLeaveDays != null">
                       funeral_leave_days = #{item.funeralLeaveDays},
                   </if>
                   <if test="item.funeralLeaveUnit != null and 
item.funeralLeaveUnit != ''">
                       funeral_leave_unit = #{item.funeralLeaveUnit},
                   </if>
                   <if test="item.paternityLeave != null">
                       paternity_leave = #{item.paternityLeave},
                   </if>
                   <if test="item.paternityLeaveDays != null">
                       paternity_leave_days = #{item.paternityLeaveDays},
                   </if>
                   <if test="item.paternityLeaveUnit != null and 
item.paternityLeaveUnit != ''">
                       paternity_leave_unit = #{item.paternityLeaveUnit},
                   </if>
                   <if test="item.parentalLeave != null">
                       parental_leave = #{item.parentalLeave},
                   </if>
                   <if test="item.parentalLeaveDays != null">
                       parental_leave_days = #{item.parentalLeaveDays},
                   </if>
                   <if test="item.parentalLeaveUnit != null and 
item.parentalLeaveUnit != ''">
                       parental_leave_unit = #{item.parentalLeaveUnit},
                   </if>
                   <if test="item.maternalLeave != null">
                       maternal_leave = #{item.maternalLeave},
                   </if>
                   <if test="item.maternalLeaveDays != null">
                       maternal_leave_days = #{item.maternalLeaveDays},
                   </if>
                   <if test="item.maternalLeaveUnit != null and 
item.maternalLeaveUnit != ''">
                       maternal_leave_unit = #{item.maternalLeaveUnit},
                   </if>
                   <if test="item.marriageLeave != null">
                       marriage_leave = #{item.marriageLeave},
                   </if>
                   <if test="item.marriageLeaveDays != null">
                       marriage_leave_days = #{item.marriageLeaveDays},
                   </if>
                   <if test="item.marriageLeaveUnit != null and 
item.marriageLeaveUnit != ''">
                       marriage_leave_unit = #{item.marriageLeaveUnit},
                   </if>
                   <if test="item.injuryLeave != null">
                       injury_leave = #{item.injuryLeave},
                   </if>
                   <if test="item.injuryLeaveDays != null">
                       injury_leave_days = #{item.injuryLeaveDays},
                   </if>
                   <if test="item.injuryLeaveUnit != null and 
item.injuryLeaveUnit != ''">
                       injury_leave_unit = #{item.injuryLeaveUnit},
                   </if>
                   <if test="item.abortionLeave != null">
                       abortion_leave = #{item.abortionLeave},
                   </if>
                   <if test="item.abortionLeaveDays != null">
                       abortion_leave_days = #{item.abortionLeaveDays},
                   </if>
                   <if test="item.abortionLeaveUnit != null and 
item.abortionLeaveUnit != ''">
                       abortion_leave_unit = #{item.abortionLeaveUnit},
                   </if>
                   <if test="item.breastfeedingLeave != null">
                       breastfeeding_leave = #{item.breastfeedingLeave},
                   </if>
                   <if test="item.breastfeedingLeaveDays != null">
                       breastfeeding_leave_days = 
#{item.breastfeedingLeaveDays},
                   </if>
                   <if test="item.breastfeedingLeaveUnit != null and 
item.breastfeedingLeaveUnit != ''">
                       breastfeeding_leave_unit = 
#{item.breastfeedingLeaveUnit},
                   </if>
                   <if test="loginName != null">
                       update_user = #{loginName},
                   </if>
                   update_dt = sysdate()
               </set>
               where id = #{item.id}
               <if test="item.attendanceDate != null">
                   and attendance_date = #{item.attendanceDate}
               </if>
           </foreach>
       </update>`
   
   affter rewritting
   update kq_attendance_daily_202403
            SET attendance_plan_id = ?,
               plan_type = ?,
               attendence_time = ?,
               real_time = ?,
               
                   organ_id = ?,
               
               
                   employee_id = ?,
               
               
               
                   post_id = ?,
               
               
                   attendance_date = ?,
               
               
               
                   work_type = ?,
               
               
               
                   attendance_status = ?,
               
               
                   business_leave = ?,
               
               
                   goout_leave = ?,
               
               
                   over_time_hour = ?,
               
               
                   over_time_hour_salary = ?,
               
               
                   leave_hour = ?,
               
               
                   leave_day = ?,
               
               
                   leave_paid_hour = ?,
               
               
                   compassionate_leave = ?,
               
               
                   compassionate_leave_days = ?,
               
               
                   compassionate_leave_unit = ?,
               
               
                   sick_leave = ?,
               
               
                   sick_leave_days = ?,
               
               
                   sick_leave_unit = ?,
               
               
                   compensatory_leave = ?,
               
               
                   compensatory_leave_days = ?,
               
               
                   compensatory_leave_unit = ?,
               
               
                   annual_leave = ?,
               
               
                   annual_leave_days = ?,
               
               
                   annual_leave_unit = ?,
               
               
                   maternity_leave = ?,
               
               
                   maternity_leave_days = ?,
               
               
                   maternity_leave_unit = ?,
               
               
                   funeral_leave = ?,
               
               
                   funeral_leave_days = ?,
               
               
                   funeral_leave_unit = ?,
               
               
                   paternity_leave = ?,
               
               
                   paternity_leave_days = ?,
               
               
                   paternity_leave_unit = ?,
               
               
                   parental_leave = ?,
               
               
                   parental_leave_days = ?,
               
               
                   parental_leave_unit = ?,
               
               
                   maternal_leave = ?,
               
               
                   maternal_leave_days = ?,
               
               
                   maternal_leave_unit = ?,
               
               
                   marriage_leave = ?,
               
               
                   marriage_leave_days = ?,
               
               
                   marriage_leave_unit = ?,
               
               
                   injury_leave = ?,
               
               
                   injury_leave_days = ?,
               
               
                   injury_leave_unit = ?,
               
               
                   abortion_leave = ?,
               
               
                   abortion_leave_days = ?,
               
               
                   abortion_leave_unit = ?,
               
               
                   breastfeeding_leave = ?,
               
               
                   breastfeeding_leave_days = ?,
               
               
                   breastfeeding_leave_unit = ?,
               
               
                   update_user = ?,
               
               update_dt = sysdate() 
           where id = ?
            
               and attendance_date = ?
            
        ; 
           update kq_attendance_daily
            SET attendance_plan_id = ?,
               plan_type = ?,
               attendence_time = ?,
               real_time = ?,
               
                   organ_id = ?,
               
               
                   employee_id = ?,
               
               
               
                   post_id = ?,
               
               
                   attendance_date = ?,
               
               
               
                   work_type = ?,
               
               
               
                   attendance_status = ?,
               
               
                   business_leave = ?,
               
               
                   goout_leave = ?,
               
               
                   over_time_hour = ?,
               
               
                   over_time_hour_salary = ?,
               
               
                   leave_hour = ?,
               
               
               
                   leave_paid_hour = ?,
               
               
                   compassionate_leave = ?,
               
               
                   compassionate_leave_days = ?,
               
               
                   compassionate_leave_unit = ?,
               
               
                   sick_leave = ?,
               
               
                   sick_leave_days = ?,
               
               
                   sick_leave_unit = ?,
               
               
                   compensatory_leave = ?,
               
               
                   compensatory_leave_days = ?,
               
               
                   compensatory_leave_unit = ?,
               
               
                   annual_leave = ?,
               
               
                   annual_leave_days = ?,
               
               
                   annual_leave_unit = ?,
               
               
                   maternity_leave = ?,
               
               
                   maternity_leave_days = ?,
               
               
                   maternity_leave_unit = ?,
               
               
                   funeral_leave = ?,
               
               
                   funeral_leave_days = ?,
               
               
                   funeral_leave_unit = ?,
               
               
                   paternity_leave = ?,
               
               
                   paternity_leave_days = ?,
               
               
                   paternity_leave_unit = ?,
               
               
                   parental_leave = ?,
               
               
                   parental_leave_days = ?,
               
               
                   parental_leave_unit = ?,
               
               
                   maternal_leave = ?,
               
               
                   maternal_leave_days = ?,
               
               
                   maternal_leave_unit = ?,
               
               
                   marriage_leave = ?,
               
               
                   marriage_leave_days = ?,
               
               
                   marriage_leave_unit = ?,
               
               
                   injury_leave = ?,
               
               
                   injury_leave_days = ?,
               
               
                   injury_leave_unit = ?,
               
               
                   abortion_leave = ?,
               
               
                   abortion_leave_days = ?,
               
               
                   abortion_leave_unit = ?,
               
               
                   breastfeeding_leave = ?,
               
               
                   breastfeeding_leave_days = ?,
               
               
                   breastfeeding_leave_unit = ?,
               
               
                   update_user = ?,
               
               update_dt = sysdate() 
           where id = ?


-- 
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]

Reply via email to