| | |
| | | <include refid="selectTjAdviceVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectList" resultType="com.ltkj.hosp.domain.TjAdvice"> |
| | | SELECT a.*,p.pro_name as proName,d.dept_name as deptName FROM `tj_advice` a |
| | | LEFT JOIN tj_project p ON a.pro_id = p.pro_id |
| | | LEFT JOIN sys_dept d ON a.dept_id = d.dept_id |
| | | <where> |
| | | <if test="deptId != null and deptId != ''"> |
| | | and a.dept_id = #{deptId} |
| | | </if> |
| | | <if test="proName != null and proName != ''"> |
| | | and p.pro_name like concat('%',#{proName},'%') |
| | | </if> |
| | | </where> |
| | | LIMIT #{page},#{pageSize} |
| | | </select> |
| | | |
| | | <select id="selectListCount" resultType="int"> |
| | | SELECT count(*) FROM `tj_advice` a |
| | | LEFT JOIN tj_project p ON a.pro_id = p.pro_id |
| | | <where> |
| | | <if test="deptId != null"> |
| | | and a.dept_id = #{deptId} |
| | | </if> |
| | | <if test="proName != null"> |
| | | and p.pro_name like concat('%',#{proName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertTjAdvice" parameterType="TjAdvice" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into tj_advice |
| | |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | | </mapper> |