department.codebook.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <codebooks>
  3. <codebook name="department" desc="部门" >
  4. <sql>
  5. <![CDATA[ SELECT departmentid, name FROM department where unitid = :unitid ]]>
  6. </sql>
  7. <param name="unitid" value="getUnitId()" scope="defined" />
  8. <where name="enable" desc="在用" >
  9. <sql>
  10. <![CDATA[ and dcode = 61 ]]>
  11. </sql>
  12. </where>
  13. <sort>
  14. <![CDATA[
  15. order by dcode asc,
  16. case when sort_number is not null and sort_number > 0 and sort_number <> 9999 then 0 else 1 end asc,
  17. case when sort_number is not null and sort_number > 0 and sort_number <> 9999 then sort_number else null end asc,
  18. create_time desc,
  19. departmentid desc
  20. ]]>
  21. </sort>
  22. </codebook>
  23. <codebook name="departmentByPost" desc="部门(通过岗位查询)" >
  24. <show text="departmentid" value="name" />
  25. <sql>
  26. <![CDATA[ select d.departmentid, d.name, p.postid from department d, post p where d.departmentid = p.departmentid and unitid = :unitid ]]>
  27. </sql>
  28. <param name="unitid" value="getUnitId()" scope="defined" />
  29. <sort>
  30. <![CDATA[
  31. order by
  32. case when p.sort_number is not null and p.sort_number > 0 and p.sort_number <> 9999 then 0 else 1 end asc,
  33. case when p.sort_number is not null and p.sort_number > 0 and p.sort_number <> 9999 then p.sort_number else null end asc,
  34. p.create_time desc,
  35. p.postid desc
  36. ]]>
  37. </sort>
  38. </codebook>
  39. </codebooks>