| | |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.util.UnifySQLFunction; |
| | | |
| | | /** |
| | | * 打卡记录 |
| | |
| | | |
| | | //获取使用到的设置规则 |
| | | StringBuilder sbPunchTime=new StringBuilder(); |
| | | sbPunchTime.append(" SELECT c.* "); |
| | | sbPunchTime.append(" FROM ( "); |
| | | sbPunchTime.append(" SELECT d.* "); |
| | | sbPunchTime.append(" FROM product_oa_punch_time d "); |
| | | sbPunchTime.append(" left JOIN product_oa_punch_record b "); |
| | | sbPunchTime.append(" on d.punch_site_uuid=b.punch_congfig_uuid and d.created_by=? where d.punch_site_uuid= ? "); |
| | | sbPunchTime.append(" ) c "); |
| | | sbPunchTime.append(" where c.uuid in ( "); |
| | | sbPunchTime.append(" SELECT DISTINCT uuid "); |
| | | sbPunchTime.append(" FROM product_oa_punch_time "); |
| | | sbPunchTime.append(" where LOCATE(?, concat(attendance_object,','))>0 "); |
| | | sbPunchTime.append(" ) "); |
| | | sbPunchTime.append("\nSELECT c.* "); |
| | | sbPunchTime.append("\nFROM ( "); |
| | | sbPunchTime.append("\n SELECT d.* "); |
| | | sbPunchTime.append("\n FROM product_oa_punch_time d "); |
| | | sbPunchTime.append("\n left JOIN product_oa_punch_record b "); |
| | | sbPunchTime.append("\n on d.punch_site_uuid=b.punch_congfig_uuid and d.created_by=? where d.punch_site_uuid= ? "); |
| | | sbPunchTime.append("\n) c "); |
| | | sbPunchTime.append("\nwhere c.uuid in ( "); |
| | | sbPunchTime.append("\n SELECT DISTINCT uuid "); |
| | | sbPunchTime.append("\n FROM product_oa_punch_time "); |
| | | sbPunchTime.append("\n where ").append(UnifySQLFunction.locateFunction("?", "concat(attendance_object,',')")).append(" >0 "); |
| | | sbPunchTime.append("\n) "); |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sbPunchTime.toString(), param1.toArray()); |
| | | |
| | | |
| | |
| | | param2.add(sign_date); |
| | | |
| | | StringBuilder sbReplenish=new StringBuilder(); |
| | | sbReplenish.append(" SELECT T1.id,T1.uuid,T1.created_by,T1.applicant,T1.replenish_date,T1.reason,"); |
| | | sbReplenish.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( T1.replacement_card_type, ',', T2.digit + 1 ), ',',- 1 ) AS type "); |
| | | sbReplenish.append(" FROM (select * from product_oa_replenish_punch where flow_flag=2) T1 "); |
| | | sbReplenish.append(" JOIN ( SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 ) T2"); |
| | | sbReplenish.append(" ON T2.digit < ( length( T1.replacement_card_type )- length( REPLACE ( T1.replacement_card_type, ',', '' ))+ 1 )"); |
| | | sbReplenish.append(" where t1.created_by=? "); |
| | | sbReplenish.append(" and DATE_FORMAT( t1.replenish_date, '%Y-%m-%d' )=? "); |
| | | sbReplenish.append("\nSELECT"); |
| | | sbReplenish.append("\n T1.id,T1.uuid,T1.created_by,T1.applicant,T1.replenish_date,T1.reason,"); |
| | | sbReplenish.append("\n ").append(UnifySQLFunction.substringIndexFuntion(UnifySQLFunction.substringIndexFuntion("T1.replacement_card_type", ",", "T2.digit + 1"), ",", "- 1")).append(" AS type "); |
| | | sbReplenish.append("\nFROM ("); |
| | | sbReplenish.append("\n select * from product_oa_replenish_punch where flow_flag=2"); |
| | | sbReplenish.append("\n) T1 "); |
| | | sbReplenish.append("\nJOIN ( SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 ) T2"); |
| | | sbReplenish.append("\nON T2.digit < ( length( T1.replacement_card_type )- length( REPLACE ( T1.replacement_card_type, ',', '' ))+ 1 )"); |
| | | sbReplenish.append("\nwhere t1.created_by=? "); |
| | | sbReplenish.append("\nand DATE_FORMAT( t1.replenish_date, '%Y-%m-%d' )=? "); |
| | | DataTableEntity dataTableEntity1 = baseDao.listTable(sbReplenish.toString(), param2.toArray()); |
| | | if(dataTableEntity1.getRows()!=0){ |
| | | |