<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="doumeemes.dao.ext.CustomerLinkmanExtMapper">
|
|
<!-- 管理页面查询 -->
|
<resultMap id="CustomerLinkmanExtListVO" type="doumeemes.dao.ext.vo.CustomerLinkmanExtListVO" autoMapping="true">
|
<id column="ID" jdbcType="INTEGER" property="id"/>
|
<association property="dmodel" javaType="doumeemes.dao.business.model.Department">
|
<id column="DMODEL_ID" jdbcType="INTEGER" property="id"/>
|
<result column="DMODEL_DELETED" jdbcType="TINYINT" property="deleted"/>
|
<result column="DMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/>
|
<result column="DMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="DMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/>
|
<result column="DMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
|
<result column="DMODEL_NAME" jdbcType="VARCHAR" property="name"/>
|
<result column="DMODEL_REMARK" jdbcType="VARCHAR" property="remark"/>
|
<result column="DMODEL_ROOT_ID" jdbcType="INTEGER" property="rootId"/>
|
<result column="DMODEL_PARENT_ID" jdbcType="INTEGER" property="parentId"/>
|
<result column="DMODEL_COMPANY_ID" jdbcType="INTEGER" property="companyId"/>
|
<result column="DMODEL_TYPE" jdbcType="TINYINT" property="type"/>
|
<result column="DMODEL_ERP_ID" jdbcType="VARCHAR" property="erpId"/>
|
<result column="DMODEL_STATUS" jdbcType="INTEGER" property="status"/>
|
<result column="DMODEL_VALID_TIME" jdbcType="TIMESTAMP" property="validTime"/>
|
<result column="DMODEL_INVALID_TIME" jdbcType="TIMESTAMP" property="invalidTime"/>
|
</association>
|
<association property="cmodel" javaType="doumeemes.dao.business.model.Customer">
|
<id column="CMODEL_ID" jdbcType="INTEGER" property="id"/>
|
<result column="CMODEL_DELETED" jdbcType="TINYINT" property="deleted"/>
|
<result column="CMODEL_CREATE_USER" jdbcType="INTEGER" property="createUser"/>
|
<result column="CMODEL_CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
<result column="CMODEL_UPDATE_USER" jdbcType="INTEGER" property="updateUser"/>
|
<result column="CMODEL_UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
|
<result column="CMODEL_REMARK" jdbcType="VARCHAR" property="remark"/>
|
<result column="CMODEL_ROOT_DEPART_ID" jdbcType="INTEGER" property="rootDepartId"/>
|
<result column="CMODEL_CREDIT_CODE" jdbcType="VARCHAR" property="creditCode"/>
|
<result column="CMODEL_NAME" jdbcType="VARCHAR" property="name"/>
|
<result column="CMODEL_TYPE" jdbcType="VARCHAR" property="type"/>
|
<result column="CMODEL_CODE" jdbcType="VARCHAR" property="code"/>
|
<result column="CMODEL_FOUND_DATE" jdbcType="TIMESTAMP" property="foundDate"/>
|
<result column="CMODEL_LEGAL_PERSON" jdbcType="VARCHAR" property="legalPerson"/>
|
<result column="CMODEL_CATEGORYY" jdbcType="VARCHAR" property="categoryy"/>
|
</association>
|
</resultMap>
|
<select id="selectList" parameterType="doumeemes.dao.ext.dto.QueryCustomerLinkmanExtDTO" resultMap="CustomerLinkmanExtListVO">
|
SELECT
|
`a`.`ID`,
|
`a`.`DELETED`,
|
`a`.`CREATE_USER`,
|
`a`.`CREATE_TIME`,
|
`a`.`UPDATE_USER`,
|
`a`.`UPDATE_TIME`,
|
`a`.`REMARK`,
|
`a`.`ROOT_DEPART_ID`,
|
`a`.`DEPART_ID`,
|
`a`.`CUSTOMER_ID`,
|
`a`.`LINKMAN`,
|
`a`.`DUTY`,
|
`a`.`PHONE`,
|
`a`.`PHONE_SEC`,
|
`a`.`PHONE_OTHER`,
|
`a`.`WEIXIN_ID`,
|
`dmodel`.`ID` AS DMODEL_ID,
|
`dmodel`.`DELETED` AS DMODEL_DELETED,
|
`dmodel`.`CREATE_USER` AS DMODEL_CREATE_USER,
|
`dmodel`.`CREATE_TIME` AS DMODEL_CREATE_TIME,
|
`dmodel`.`UPDATE_USER` AS DMODEL_UPDATE_USER,
|
`dmodel`.`UPDATE_TIME` AS DMODEL_UPDATE_TIME,
|
`dmodel`.`NAME` AS DMODEL_NAME,
|
`dmodel`.`REMARK` AS DMODEL_REMARK,
|
`dmodel`.`ROOT_ID` AS DMODEL_ROOT_ID,
|
`dmodel`.`PARENT_ID` AS DMODEL_PARENT_ID,
|
`dmodel`.`COMPANY_ID` AS DMODEL_COMPANY_ID,
|
`dmodel`.`TYPE` AS DMODEL_TYPE,
|
`dmodel`.`ERP_ID` AS DMODEL_ERP_ID,
|
`dmodel`.`STATUS` AS DMODEL_STATUS,
|
`dmodel`.`VALID_TIME` AS DMODEL_VALID_TIME,
|
`dmodel`.`INVALID_TIME` AS DMODEL_INVALID_TIME,
|
`cmodel`.`ID` AS CMODEL_ID,
|
`cmodel`.`DELETED` AS CMODEL_DELETED,
|
`cmodel`.`CREATE_USER` AS CMODEL_CREATE_USER,
|
`cmodel`.`CREATE_TIME` AS CMODEL_CREATE_TIME,
|
`cmodel`.`UPDATE_USER` AS CMODEL_UPDATE_USER,
|
`cmodel`.`UPDATE_TIME` AS CMODEL_UPDATE_TIME,
|
`cmodel`.`REMARK` AS CMODEL_REMARK,
|
`cmodel`.`ROOT_DEPART_ID` AS CMODEL_ROOT_DEPART_ID,
|
`cmodel`.`CREDIT_CODE` AS CMODEL_CREDIT_CODE,
|
`cmodel`.`NAME` AS CMODEL_NAME,
|
`cmodel`.`TYPE` AS CMODEL_TYPE,
|
`cmodel`.`CODE` AS CMODEL_CODE,
|
`cmodel`.`FOUND_DATE` AS CMODEL_FOUND_DATE,
|
`cmodel`.`LEGAL_PERSON` AS CMODEL_LEGAL_PERSON,
|
`cmodel`.`CATEGORYY` AS CMODEL_CATEGORYY
|
FROM `customer_linkman` `a`
|
LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID
|
LEFT JOIN `customer` `cmodel` ON a.CUSTOMER_ID=cmodel.ID
|
<where>
|
<if test="id != null">
|
AND `a`.`ID` = #{id}
|
</if>
|
<if test="deleted != null">
|
AND `a`.`DELETED` = #{deleted}
|
</if>
|
<if test="createUser != null">
|
AND `a`.`CREATE_USER` = #{createUser}
|
</if>
|
<if test="createTime != null">
|
AND `a`.`CREATE_TIME` = #{createTime}
|
</if>
|
<if test="updateUser != null">
|
AND `a`.`UPDATE_USER` = #{updateUser}
|
</if>
|
<if test="updateTime != null">
|
AND `a`.`UPDATE_TIME` = #{updateTime}
|
</if>
|
<if test="remark != null and remark != ''">
|
AND `a`.`REMARK` = #{remark}
|
</if>
|
<if test="rootDepartId != null">
|
AND `a`.`ROOT_DEPART_ID` = #{rootDepartId}
|
</if>
|
<if test="departId != null">
|
AND `a`.`DEPART_ID` = #{departId}
|
</if>
|
<if test="customerId != null">
|
AND `a`.`CUSTOMER_ID` = #{customerId}
|
</if>
|
<if test="linkman != null and linkman != ''">
|
AND `a`.`LINKMAN` = #{linkman}
|
</if>
|
<if test="duty != null and duty != ''">
|
AND `a`.`DUTY` = #{duty}
|
</if>
|
<if test="phone != null and phone != ''">
|
AND `a`.`PHONE` = #{phone}
|
</if>
|
<if test="phoneSec != null and phoneSec != ''">
|
AND `a`.`PHONE_SEC` = #{phoneSec}
|
</if>
|
<if test="phoneOther != null and phoneOther != ''">
|
AND `a`.`PHONE_OTHER` = #{phoneOther}
|
</if>
|
<if test="weixinId != null and weixinId != ''">
|
AND `a`.`WEIXIN_ID` = #{weixinId}
|
</if>
|
<if test="dmodelId != null">
|
AND `dmodel`.`ID` = #{dmodelId}
|
</if>
|
<if test="dmodelDeleted != null">
|
AND `dmodel`.`DELETED` = #{dmodelDeleted}
|
</if>
|
<if test="dmodelCreateUser != null">
|
AND `dmodel`.`CREATE_USER` = #{dmodelCreateUser}
|
</if>
|
<if test="dmodelCreateTime != null">
|
AND `dmodel`.`CREATE_TIME` = #{dmodelCreateTime}
|
</if>
|
<if test="dmodelUpdateUser != null">
|
AND `dmodel`.`UPDATE_USER` = #{dmodelUpdateUser}
|
</if>
|
<if test="dmodelUpdateTime != null">
|
AND `dmodel`.`UPDATE_TIME` = #{dmodelUpdateTime}
|
</if>
|
<if test="dmodelName != null and dmodelName != ''">
|
AND `dmodel`.`NAME` = #{dmodelName}
|
</if>
|
<if test="dmodelRemark != null and dmodelRemark != ''">
|
AND `dmodel`.`REMARK` = #{dmodelRemark}
|
</if>
|
<if test="dmodelRootId != null">
|
AND `dmodel`.`ROOT_ID` = #{dmodelRootId}
|
</if>
|
<if test="dmodelParentId != null">
|
AND `dmodel`.`PARENT_ID` = #{dmodelParentId}
|
</if>
|
<if test="dmodelCompanyId != null">
|
AND `dmodel`.`COMPANY_ID` = #{dmodelCompanyId}
|
</if>
|
<if test="dmodelType != null">
|
AND `dmodel`.`TYPE` = #{dmodelType}
|
</if>
|
<if test="dmodelErpId != null and dmodelErpId != ''">
|
AND `dmodel`.`ERP_ID` = #{dmodelErpId}
|
</if>
|
<if test="dmodelStatus != null">
|
AND `dmodel`.`STATUS` = #{dmodelStatus}
|
</if>
|
<if test="dmodelValidTime != null">
|
AND `dmodel`.`VALID_TIME` = #{dmodelValidTime}
|
</if>
|
<if test="dmodelInvalidTime != null">
|
AND `dmodel`.`INVALID_TIME` = #{dmodelInvalidTime}
|
</if>
|
<if test="cmodelId != null">
|
AND `cmodel`.`ID` = #{cmodelId}
|
</if>
|
<if test="cmodelDeleted != null">
|
AND `cmodel`.`DELETED` = #{cmodelDeleted}
|
</if>
|
<if test="cmodelCreateUser != null">
|
AND `cmodel`.`CREATE_USER` = #{cmodelCreateUser}
|
</if>
|
<if test="cmodelCreateTime != null">
|
AND `cmodel`.`CREATE_TIME` = #{cmodelCreateTime}
|
</if>
|
<if test="cmodelUpdateUser != null">
|
AND `cmodel`.`UPDATE_USER` = #{cmodelUpdateUser}
|
</if>
|
<if test="cmodelUpdateTime != null">
|
AND `cmodel`.`UPDATE_TIME` = #{cmodelUpdateTime}
|
</if>
|
<if test="cmodelRemark != null and cmodelRemark != ''">
|
AND `cmodel`.`REMARK` = #{cmodelRemark}
|
</if>
|
<if test="cmodelRootDepartId != null">
|
AND `cmodel`.`ROOT_DEPART_ID` = #{cmodelRootDepartId}
|
</if>
|
<if test="cmodelCreditCode != null and cmodelCreditCode != ''">
|
AND `cmodel`.`CREDIT_CODE` = #{cmodelCreditCode}
|
</if>
|
<if test="cmodelName != null and cmodelName != ''">
|
AND `cmodel`.`NAME` = #{cmodelName}
|
</if>
|
<if test="cmodelType != null and cmodelType != ''">
|
AND `cmodel`.`TYPE` = #{cmodelType}
|
</if>
|
<if test="cmodelCode != null and cmodelCode != ''">
|
AND `cmodel`.`CODE` = #{cmodelCode}
|
</if>
|
<if test="cmodelFoundDate != null">
|
AND `cmodel`.`FOUND_DATE` = #{cmodelFoundDate}
|
</if>
|
<if test="cmodelLegalPerson != null and cmodelLegalPerson != ''">
|
AND `cmodel`.`LEGAL_PERSON` = #{cmodelLegalPerson}
|
</if>
|
<if test="cmodelCategoryy != null and cmodelCategoryy != ''">
|
AND `cmodel`.`CATEGORYY` = #{cmodelCategoryy}
|
</if>
|
</where>
|
</select>
|
</mapper>
|