|
|
@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="gap" column="gap" />
|
|
|
<result property="sendType" column="send_type" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
+ <result property="templateType" column="template_type" />
|
|
|
+ <result property="isTop" column="is_top" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectQwSopTempVo">
|
|
|
@@ -41,7 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
<if test="sort != null "> and sort = #{sort}</if>
|
|
|
- <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ <if test="companyId != null ">
|
|
|
+ AND (company_id = #{companyId} OR template_type = 1)
|
|
|
+ </if>
|
|
|
<if test="sendType != null "> and send_type = #{sendType}</if>
|
|
|
<if test="createBy != null "> and create_by = #{createBy}</if>
|
|
|
<if test="cuDeptIdList != null and !cuDeptIdList.isEmpty()">
|
|
|
@@ -51,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by sort,create_time desc
|
|
|
+ order by is_top desc, sort, create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectQwSopTempById" parameterType="String" resultMap="QwSopTempResult">
|
|
|
@@ -82,6 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="data.gap != null">gap,</if>
|
|
|
<if test="data.sendType != null">send_type,</if>
|
|
|
<if test="data.updateTime != null">update_time,</if>
|
|
|
+ <if test="data.templateType != null">template_type,</if>
|
|
|
+ <if test="data.isTop != null">is_top,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="data.id != null">#{data.id},</if>
|
|
|
@@ -95,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="data.gap != null">#{data.gap},</if>
|
|
|
<if test="data.sendType != null">#{data.sendType},</if>
|
|
|
<if test="data.updateTime != null">#{data.updateTime},</if>
|
|
|
+ <if test="data.templateType != null">#{data.templateType},</if>
|
|
|
+ <if test="data.isTop != null">#{data.isTop},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
@@ -111,6 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="data.gap != null">gap = #{data.gap},</if>
|
|
|
<if test="data.sendType != null">send_type = #{data.sendType},</if>
|
|
|
<if test="data.updateTime != null">update_time = #{data.updateTime},</if>
|
|
|
+ <if test="data.templateType != null">template_type = #{data.templateType},</if>
|
|
|
+ <if test="data.isTop != null">is_top = #{data.isTop},</if>
|
|
|
</trim>
|
|
|
where id = #{data.id}
|
|
|
</update>
|