| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <#-- 部门信息表 -->
- <#-- 查询所有项目 -->
-
- SELECT
- tsd.id,
- tsd.parentdepartid,
- tsd.departname,
- tsd.org_code AS orgCode,
- tsd.org_type AS orgType,
- tsd.status,
- tsd.fincode as finCode
- FROM
- t_s_depart tsd
- where 1=1 and tsd.parentdepartid = '4028e4a55f6c84ec015f6ca5c6ab0001'
- <#if ( projectDepartDto.orgTypeList )?? && projectDepartDto.orgTypeList ?size gt 0>
- and tsd.org_type in(
- <#list projectDepartDto.orgTypeList as item>
- '${item}'
- <#if item_has_next>,</#if>
- </#list>
- )
- <#else >
- and tsd.org_type=null
- </#if>
- <#if ( projectDepartDto.departName )?? && projectDepartDto.departName ?length gt 0>
- and tsd.departname like CONCAT('%', :projectDepartDto.departName ,'%')
- </#if>
- <#if ( projectDepartDto.userid )?? && projectDepartDto.userid ?length gt 0>
- and tsd.id in (
- select org.org_id from t_s_user_org org where org.user_id=:projectDepartDto.userid and org.status=0
- )
- </#if>
- and tsd.status = '0'
|