|
@@ -3,7 +3,7 @@
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.fs.company.mapper.CompanyPostMapper">
|
|
<mapper namespace="com.fs.company.mapper.CompanyPostMapper">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="CompanyPost" id="CompanyPostResult">
|
|
<resultMap type="CompanyPost" id="CompanyPostResult">
|
|
<result property="postId" column="post_id" />
|
|
<result property="postId" column="post_id" />
|
|
<result property="companyId" column="company_id" />
|
|
<result property="companyId" column="company_id" />
|
|
@@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectCompanyPostList" parameterType="CompanyPost" resultMap="CompanyPostResult">
|
|
<select id="selectCompanyPostList" parameterType="CompanyPost" resultMap="CompanyPostResult">
|
|
<include refid="selectCompanyPostVo"/>
|
|
<include refid="selectCompanyPostVo"/>
|
|
- <where>
|
|
|
|
|
|
+ <where>
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
|
<if test="postCode != null and postCode != ''"> and post_code = #{postCode}</if>
|
|
<if test="postCode != null and postCode != ''"> and post_code = #{postCode}</if>
|
|
<if test="postName != null and postName != ''"> and post_name like concat('%', #{postName}, '%')</if>
|
|
<if test="postName != null and postName != ''"> and post_name like concat('%', #{postName}, '%')</if>
|
|
@@ -32,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="selectCompanyPostById" parameterType="Long" resultMap="CompanyPostResult">
|
|
<select id="selectCompanyPostById" parameterType="Long" resultMap="CompanyPostResult">
|
|
<include refid="selectCompanyPostVo"/>
|
|
<include refid="selectCompanyPostVo"/>
|
|
where post_id = #{postId}
|
|
where post_id = #{postId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<insert id="insertCompanyPost" parameterType="CompanyPost" useGeneratedKeys="true" keyProperty="postId">
|
|
<insert id="insertCompanyPost" parameterType="CompanyPost" useGeneratedKeys="true" keyProperty="postId">
|
|
insert into company_post
|
|
insert into company_post
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCompanyPostByIds" parameterType="String">
|
|
<delete id="deleteCompanyPostByIds" parameterType="String">
|
|
- delete from company_post where post_id in
|
|
|
|
|
|
+ delete from company_post where post_id in
|
|
<foreach item="postId" collection="array" open="(" separator="," close=")">
|
|
<foreach item="postId" collection="array" open="(" separator="," close=")">
|
|
#{postId}
|
|
#{postId}
|
|
</foreach>
|
|
</foreach>
|
|
@@ -117,4 +117,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
left join company_user u on u.user_id = up.user_id
|
|
left join company_user u on u.user_id = up.user_id
|
|
where u.user_id = #{user_id}
|
|
where u.user_id = #{user_id}
|
|
</select>
|
|
</select>
|
|
-</mapper>
|
|
|
|
|
|
+
|
|
|
|
+ <select id="selectCompanyPostByIds" resultType="com.fs.company.domain.CompanyPost">
|
|
|
|
+ <include refid="selectCompanyPostVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="postIds != null">
|
|
|
|
+ post_id in
|
|
|
|
+ <foreach collection="postIds" item="id" open="(" close=")" separator=",">
|
|
|
|
+ #{id}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|