|
@@ -27,7 +27,7 @@ public interface YpZdDeptMapper {
|
|
|
* @return
|
|
|
*/
|
|
|
@Insert("insert into yp_zd_dept (dept_code,charge_code,use_flag)" +
|
|
|
- " SELECT dept_code,#{chargeCode},'1' FROM zy_adtward WITH(NOLOCK) where dept_code!=#{deptCode}")
|
|
|
+ " SELECT code,#{chargeCode},'1' FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2) and code!=#{deptCode}")
|
|
|
int insertExclusiveYpZdDept(YpZdDept ypZdDept);
|
|
|
|
|
|
/**
|
|
@@ -76,7 +76,7 @@ public interface YpZdDeptMapper {
|
|
|
*/
|
|
|
@Select("<script>" +
|
|
|
"select (case" +
|
|
|
- " when sum(1)=(SELECT sum(1) as number FROM zy_adtward WITH(NOLOCK))-1" +
|
|
|
+ " when sum(1)=(SELECT sum(1) as number FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2))-1" +
|
|
|
" then (select case when sum(1)<![CDATA[>]]>0 then 0 else 1 end from yp_zd_dept WITH(NOLOCK) where charge_code=#{chargeCode} and dept_code=#{deptCode})" +
|
|
|
" else '0'" +
|
|
|
" end) as exclusive_use_flag" +
|