| | |
| | | |
| | | <select id="lazyList" resultMap="deptVOResultMap"> |
| | | SELECT |
| | | dept.* , |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | dept.* , |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | sys_jurisdiction |
| | | WHERE |
| | | parent_id = dept.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | WHERE |
| | | parent_id = dept.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM |
| | | sys_jurisdiction dept |
| | | WHERE dept.is_deleted = 0 |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="lazyTree" resultMap="treeNodeResultMap" > |
| | | SELECT |
| | | dept.id, |
| | | dept.parent_id, |
| | | dept.dept_name AS title, |
| | | dept.id AS "value", |
| | | dept.id AS "key", |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | sys_jurisdiction |
| | | WHERE |
| | | parent_id = dept.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM |
| | | sys_jurisdiction dept |
| | | WHERE dept.is_deleted = 0 |
| | | <if test="param1!=null and param1!=''"> |
| | | and dept.tenant_id = #{param1} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="lazyTrees" resultMap="treeNodeResultMap" > |
| | | <select id="lazyTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | dept.id, |
| | | dept.parent_id, |
| | |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | sys_jurisdiction |
| | | sys_jurisdiction |
| | | WHERE |
| | | parent_id = dept.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM |
| | | sys_jurisdiction dept |
| | | sys_jurisdiction dept |
| | | WHERE dept.is_deleted = 0 |
| | | <if test="param1!=null and param1!=''"> |
| | | and dept.tenant_id = #{param1} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="lazyTrees" resultMap="treeNodeResultMap"> |
| | | SELECT dept.id, |
| | | dept.parent_id, |
| | | dept.dept_name AS title, |
| | | dept.id AS "value", |
| | | dept.id AS "key", |
| | | ( |
| | | SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM sys_jurisdiction |
| | | WHERE parent_id = dept.id |
| | | and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM sys_jurisdiction dept |
| | | WHERE dept.is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="Test" resultType="java.util.HashMap"> |
| | | SELECT wgmc, wgbj |
| | | FROM nb_wgxx |
| | | WHERE wgbj is NOT NULL |
| | | and wglx = 'W3' |
| | | </select> |
| | | |
| | | |
| | | <update id="update"> |
| | | update sys_jurisdiction |
| | | set space=ST_GeomFromText(${space}) |
| | | where dept_name = #{deptname} |
| | | </update> |
| | | |
| | | |
| | | <!-- <!–判断打卡点是否在电子围栏内–>--> |
| | | <!-- <select id="isOnArea" resultType="java.util.HashMap">--> |
| | | <!-- select id,dept_name from sys_jurisdiction--> |
| | | <!-- where--> |
| | | <!-- MBRWithin(ST_GeomFromText('POINT(${jd} ${wd})'),space)--> |
| | | <!-- </select>--> |
| | | <!--判断打卡点是否在电子围栏内--> |
| | | <select id="isOnArea" resultType="java.util.HashMap"> |
| | | select id, dept_name |
| | | from sys_jurisdiction |
| | | where MBRWithin(ST_GeomFromText('POINT(${jd} ${wd})'), space) LIMIT 0,1; |
| | | </select> |
| | | </mapper> |