|
@@ -20,20 +20,36 @@
|
|
a.office AS "office",
|
|
a.office AS "office",
|
|
b.name AS "clientId.name"
|
|
b.name AS "clientId.name"
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
|
|
+ <sql id="linkManColumn">
|
|
|
|
+ a.id AS "id",
|
|
|
|
+ a.name AS "name",
|
|
|
|
+ a.position AS "position",
|
|
|
|
+ a.qq AS "qq",
|
|
|
|
+ a.link_phone AS "linkPhone",
|
|
|
|
+ a.link_mobile AS "linkMobile",
|
|
|
|
+ a.email AS "email",
|
|
|
|
+ a.is_default AS "isDefault",
|
|
|
|
+ a.create_by AS "createBy.id",
|
|
|
|
+ a.create_date AS "createDate",
|
|
|
|
+ a.update_by AS "updateBy.id",
|
|
|
|
+ a.update_date AS "updateDate",
|
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
|
+ a.client_id AS "clientId.id",
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
<sql id="workClientLinkmanJoins">
|
|
<sql id="workClientLinkmanJoins">
|
|
LEFT JOIN work_client_info b ON b.id = a.client_id
|
|
LEFT JOIN work_client_info b ON b.id = a.client_id
|
|
</sql>
|
|
</sql>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<select id="get" resultType="WorkClientLinkman" >
|
|
<select id="get" resultType="WorkClientLinkman" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workClientLinkmanColumns"/>
|
|
<include refid="workClientLinkmanColumns"/>
|
|
FROM work_client_linkman a
|
|
FROM work_client_linkman a
|
|
<include refid="workClientLinkmanJoins"/>
|
|
<include refid="workClientLinkmanJoins"/>
|
|
WHERE a.id = #{id}
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="findByClientId" resultType="WorkClientLinkman">
|
|
<select id="findByClientId" resultType="WorkClientLinkman">
|
|
SELECT <include refid="workClientLinkmanColumns"/>
|
|
SELECT <include refid="workClientLinkmanColumns"/>
|
|
FROM work_client_linkman a
|
|
FROM work_client_linkman a
|
|
@@ -63,14 +79,14 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findList" resultType="WorkClientLinkman" >
|
|
<select id="findList" resultType="WorkClientLinkman" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workClientLinkmanColumns"/>
|
|
<include refid="workClientLinkmanColumns"/>
|
|
FROM work_client_linkman a
|
|
FROM work_client_linkman a
|
|
<include refid="workClientLinkmanJoins"/>
|
|
<include refid="workClientLinkmanJoins"/>
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
- AND a.name LIKE
|
|
|
|
|
|
+ AND a.name LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
|
|
@@ -142,13 +158,13 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findAllList" resultType="WorkClientLinkman" >
|
|
<select id="findAllList" resultType="WorkClientLinkman" >
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
<include refid="workClientLinkmanColumns"/>
|
|
<include refid="workClientLinkmanColumns"/>
|
|
FROM work_client_linkman a
|
|
FROM work_client_linkman a
|
|
<include refid="workClientLinkmanJoins"/>
|
|
<include refid="workClientLinkmanJoins"/>
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
- </where>
|
|
|
|
|
|
+ </where>
|
|
<choose>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
ORDER BY ${page.orderBy}
|
|
@@ -212,9 +228,9 @@
|
|
#{office}
|
|
#{office}
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
-
|
|
|
|
|
|
+
|
|
<update id="update">
|
|
<update id="update">
|
|
- UPDATE work_client_linkman SET
|
|
|
|
|
|
+ UPDATE work_client_linkman SET
|
|
name = #{name},
|
|
name = #{name},
|
|
position = #{position},
|
|
position = #{position},
|
|
qq = #{qq},
|
|
qq = #{qq},
|
|
@@ -228,8 +244,8 @@
|
|
office = #{office}
|
|
office = #{office}
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<!--物理删除-->
|
|
<!--物理删除-->
|
|
<update id="delete">
|
|
<update id="delete">
|
|
DELETE FROM work_client_linkman
|
|
DELETE FROM work_client_linkman
|
|
@@ -242,10 +258,10 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
|
|
+
|
|
<!--逻辑删除-->
|
|
<!--逻辑删除-->
|
|
<update id="deleteByLogic">
|
|
<update id="deleteByLogic">
|
|
- UPDATE work_client_linkman SET
|
|
|
|
|
|
+ UPDATE work_client_linkman SET
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
<choose>
|
|
<choose>
|
|
<when test="id !=null and id != ''">
|
|
<when test="id !=null and id != ''">
|
|
@@ -256,8 +272,8 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</update>
|
|
</update>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
<select id="findUniqueByProperty" resultType="WorkClientLinkman" statementType="STATEMENT">
|
|
<select id="findUniqueByProperty" resultType="WorkClientLinkman" statementType="STATEMENT">
|
|
select * FROM work_client_linkman where ${propertyName} = '${value}'
|
|
select * FROM work_client_linkman where ${propertyName} = '${value}'
|
|
@@ -269,4 +285,10 @@
|
|
FROM project_client_linkman p,work_client_linkman a,work_client_info b
|
|
FROM project_client_linkman p,work_client_linkman a,work_client_info b
|
|
WHERE p.linkman_id = a.id and b.id = a.client_id and p.project_id=#{projectId} and is_entrust = #{isEntrust}
|
|
WHERE p.linkman_id = a.id and b.id = a.client_id and p.project_id=#{projectId} and is_entrust = #{isEntrust}
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <select id="queryLinkManByClientId" resultType="WorkClientLinkman">
|
|
|
|
+ select *
|
|
|
|
+ from work_client_linkman
|
|
|
|
+ where client_id = #{id}
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|