|
|
@ -4,15 +4,20 @@ |
|
|
|
<mapper namespace="com.epmet.dao.org.CustomerDepartmentDao"> |
|
|
|
|
|
|
|
<select id="listDepartmentsByCreatedTime" resultType="com.epmet.entity.org.CustomerDepartmentEntity"> |
|
|
|
SELECT * |
|
|
|
FROM customer_department |
|
|
|
SELECT |
|
|
|
ca.AREA_CODE, |
|
|
|
dept.* |
|
|
|
FROM |
|
|
|
customer_department dept |
|
|
|
LEFT JOIN customer_agency ca ON ( |
|
|
|
dept.AGENCY_ID = ca.id and ca.DEL_FLAG='0') |
|
|
|
<where> |
|
|
|
DEL_FLAG = 0 |
|
|
|
dept.DEL_FLAG = 0 |
|
|
|
<if test="createdTimeFrom != null"> |
|
|
|
AND CREATED_TIME >= #{createdTimeFrom} |
|
|
|
AND dept.CREATED_TIME >= #{createdTimeFrom} |
|
|
|
</if> |
|
|
|
<if test="createdTimeTo != null"> |
|
|
|
AND CREATED_TIME < #{createdTimeTo} |
|
|
|
AND dept.CREATED_TIME < #{createdTimeTo} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
@ -20,20 +25,23 @@ |
|
|
|
|
|
|
|
<select id="listDepartmentsByUpdatedTime" resultType="com.epmet.entity.org.CustomerDepartmentEntity"> |
|
|
|
select |
|
|
|
id, |
|
|
|
customer_id, |
|
|
|
agency_id, |
|
|
|
department_name, |
|
|
|
department_duty, |
|
|
|
total_user, |
|
|
|
del_flag, |
|
|
|
revision, |
|
|
|
created_by, |
|
|
|
created_time, |
|
|
|
updated_by, |
|
|
|
updated_time |
|
|
|
from customer_department |
|
|
|
where UPDATED_TIME > #{startTime} |
|
|
|
and UPDATED_TIME <![CDATA[<=]]> #{endTime} |
|
|
|
cd.id, |
|
|
|
cd.customer_id, |
|
|
|
cd.agency_id, |
|
|
|
cd.department_name, |
|
|
|
cd.department_duty, |
|
|
|
cd.total_user, |
|
|
|
cd.del_flag, |
|
|
|
cd.revision, |
|
|
|
cd.created_by, |
|
|
|
cd.created_time, |
|
|
|
cd.updated_by, |
|
|
|
cd.updated_time, |
|
|
|
ca.area_code |
|
|
|
from customer_department cd |
|
|
|
LEFT JOIN customer_agency ca ON ( |
|
|
|
cd.AGENCY_ID = ca.id and ca.DEL_FLAG='0') |
|
|
|
where cd.UPDATED_TIME > #{startTime} |
|
|
|
and cd.UPDATED_TIME <![CDATA[<=]]> #{endTime} |
|
|
|
</select> |
|
|
|
</mapper> |