|
@@ -9,25 +9,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="deptInfo" column="dept_info" />
|
|
<result property="deptInfo" column="dept_info" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="year" column="year" />
|
|
<result property="year" column="year" />
|
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTDeptInfoVo">
|
|
<sql id="selectTDeptInfoVo">
|
|
- select id, dept_info, dept_id, year from t_dept_info
|
|
|
|
|
|
+ select d.id, d.dept_info, d.dept_id, sd.dept_name , d.year from t_dept_info d
|
|
|
|
+ left join sys_dept sd on d.dept_id = sd.dept_id
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectTDeptInfoList" parameterType="TDeptInfo" resultMap="TDeptInfoResult">
|
|
<select id="selectTDeptInfoList" parameterType="TDeptInfo" resultMap="TDeptInfoResult">
|
|
<include refid="selectTDeptInfoVo"/>
|
|
<include refid="selectTDeptInfoVo"/>
|
|
<where>
|
|
<where>
|
|
- <if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
|
|
|
+ <if test="year != null and year != ''"> and d.year = #{year}</if>
|
|
|
|
|
|
- <if test="deptInfo != null and deptInfo != ''"> and dept_info = #{deptInfo}</if>
|
|
|
|
- <if test="deptId != null "> and dept_id like concat(concat('%', #{deptId}), '%')</if>
|
|
|
|
|
|
+ <if test="deptInfo != null and deptInfo != ''"> and d.dept_info = #{deptInfo}</if>
|
|
|
|
+ <if test="deptId != null "> and d.dept_id like concat(concat('%', #{deptId}), '%')</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectTDeptInfoById" parameterType="Long" resultMap="TDeptInfoResult">
|
|
<select id="selectTDeptInfoById" parameterType="Long" resultMap="TDeptInfoResult">
|
|
<include refid="selectTDeptInfoVo"/>
|
|
<include refid="selectTDeptInfoVo"/>
|
|
- where id = #{id}
|
|
|
|
|
|
+ where d.id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="insertTDeptInfo" parameterType="TDeptInfo" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertTDeptInfo" parameterType="TDeptInfo" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -55,11 +57,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTDeptInfoById" parameterType="Long">
|
|
<delete id="deleteTDeptInfoById" parameterType="Long">
|
|
- delete from t_dept_info where id = #{id}
|
|
|
|
|
|
+ delete from t_dept_info where d.id = #{id}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTDeptInfoByIds" parameterType="String">
|
|
<delete id="deleteTDeptInfoByIds" parameterType="String">
|
|
- delete from t_dept_info where id in
|
|
|
|
|
|
+ delete from t_dept_info where d.id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
#{id}
|
|
</foreach>
|
|
</foreach>
|